3 replies
by bentley Accepted solution
by ic-it Accepted solution
Will run with system credentials. Is there a specific reason that the batch file needs user interaction?
Otherwise just use a WOL and let it run.
by scott_heath Accepted solution
I'm sure someone will say this is too complicated, but I like to use vbscript for stuff like this. You can use something like this:
Set oRoot = GetObject("LDAP: //RootDSE")
strRoot = oRoot.Get("defaultNamingContext")
path = "LDAP://" & strRoot
Set oConnect = CreateObject("ADODB.Connection")
Set oCommand = CreateObject("ADODB.Command")
oConnect.Provider = "ADsDSOObject"
oConnect.Open "Active Directory Provider"
Set oCommand.ActiveConnection = oConnect
oCommand.CommandText = "SELECT name FROM '" & path & "' WHERE objectClass='Computer'"
Set result = oCommand.Execute
For i = 1 to result.recordcount
computername = result(0).value
{code to do stuff}
result.movenext
Next
This discussion is closed to new replies.
Trending Desktop posts
Sort by Trending