Check Directory Juction Exist from SCCM
One of the steps in my Task sequence is calling a "CMD" file, which creates a Directory Junction on client machine (mklink /j "C:\Users\All Users" "C:\ProgramData"). If the Junction already exist on the machine, it throws an error. Is there any way to check whether the Directory Junction is existing or not via WMI Query or any other option. Thanks in advance.
May 26th, 2010 10:06pm

I think you will have to do that in vbscript. John Marcum | http://myitforum.com/cs2/blogs/jmarcum |
Free Windows Admin Tool Kit Click here and download it now
May 26th, 2010 10:18pm

How about using "if exists" to check whether c:\users\all users exists?Jason | http://myitforum.com/cs2/blogs/jsandys | http://blogs.catapultsystems.com/jsandys/default.aspx | Twitter @JasonSandys
May 26th, 2010 11:16pm

I tried the same (If exist) as a first thing, but i throws the error as follows: Severity Type Site code Date / Time System Component Message ID Description Error Milestone GOU 5/26/2010 4:07:59 PM BM09SMS01 Software Distribution 10006 The program for advertisement "GOU20158" failed ("GOU00184" - "*"). A failure exit code of 1018 was returned. User context: NT AUTHORITY\SYSTEM Possible cause: Systems Management Server (SMS) determines status for each program it executes. If SMS cannot find or correlate any installation status Management Information Format (MIF) files for the program, it uses the program's exit code to determine status. An exit code of 1018 is considered a failure. Solution: For more information on the exit code, refer to the documentation for the program you are distributing. Thinking of writing command line with "If Condition".. not sure ... Goooogling :) If anyone knows please provide the script for achiveing the same.
Free Windows Admin Tool Kit Click here and download it now
May 26th, 2010 11:38pm

"dir /al" will list junctions. Or have a look at http://msdn.microsoft.com/en-us/library/bb968829(VS.85).aspx: " These junction points can be identified as follows: They have the FILE_ATTRIBUTE_REPARSE_POINT, FILE_ATTRIBUTE_HIDDEN, and FILE_ATTRIBUTE_SYSTEM file attributes set. They also have their access control lists (ACLs) set to deny read access to everyone."
May 27th, 2010 12:27am

Sysinternals have a tool called Junction, which can help you determine if a file is a junction. You can use it. For more information: Junction v1.05 http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx Hope it helps.
Free Windows Admin Tool Kit Click here and download it now
May 28th, 2010 10:22am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics