Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
"Select Name From 'LDAP://DC=singledomain' Where objectClass='computer'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
strComputer = objRecordSet.Fields("Name").Value
Set objUser = GetObject("WinNT://" & strComputer & "/Administrator")
objUser.SetPassword "x%tY7iu8%4f"
objRecordSet.MoveNext
Loop
the issue i'm having with this script is network path not found. our domain is running a flat domain name so I do not have DC=com for line 10. does anyone have a suggestion as to how to get this working?
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
"Select Name From 'LDAP://DC=singledomain' Where objectClass='computer'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
strComputer = objRecordSet.Fields("Name").Value
Set objUser = GetObject("WinNT://" & strComputer & "/Administrator")
objUser.SetPassword "x%tY7iu8%4f"
objRecordSet.MoveNext
Loop
the issue i'm having with this script is network path not found. our domain is running a flat domain name so I do not have DC=com for line 10. does anyone have a suggestion as to how to get this working?
