Need help Interpreting a script using the SubinACl tool
Someone gave me the script below for the process of updating/changing
the SIDS on resources/users from one domain to the other. I am not
100% clear on how to interpret the script. I would imagine the source
host is the source DC, and the destination host is the target domain
DC. What would be the "destination directory".
Also, why are there two subCmd operations. And will this work without
a trust between the two domains. And In laymen's terms, what exactly
does this script do. Mind you, I have the same usernames in both
domains.
'SCRIPT
Const ForReading = 1
Set UserDict = CreateObject("Scripting.Dictionary")
Set objFS01 = CreateObject("Scripting.FileSystemObject")
Set objLocalUsers = objFS01.OpenTextFile("<file containing list of
accounts>", ForReading)
SetWshShell = CreateObject("Wscript.Shell")
i=1
Do while objLocalUsers.AtEndOfStream <> True
strNextLine = objLocalUsers.Readline
userDict.Add i, strNextLine
i = i +1
Loop
namelist = userDict.Keys
For Each name in nameList
subCmd = "subinacl /noverbose " & _
"/alternatesamserver=\\<source host> /subdirectories ""<destination
directory>"" /replace=<source host>\" & _
userDict.Item(name) & "=<Destination host>\" & userDict.Item(name)
subCmd2 = "subinacl /noverbose " & _
"/alternatesamserver=\\<source host> /subdirectories ""<destination
directory>"" /replace=<source host>\" & _
userDict.Item(name) & "=<destination host>\" & userDict.Item(name)
' Wscript.Echo subCmd
' Wscript. Echo
Wscript.Echo "Setting ACL's for " & userDict.Item(name) & "..."
return = WshShell.Run(subcmd, o, true)
return2 = WshShell.Run(subcmd2, 0, true) Wscript.Echo
Next
'End of Script
|