I am trying to write a script that will search AD for the word “resident” in the Office field of the User Properties in Active Directory. Below is the code I’ve come up with, but for some reason it’s not working. Any vbscripters out there that can take a peek and tell me what I’m missing??
strBase = “
strFilter = “
strAttrs = “
strScope = “
‘ —— END CONFIGURATION ———
set objConn = CreateObject(“ADODB.Connection”)
objConn.Provider = “ADsDSOObject”
objConn.Open “Active Directory Provider”
set objRS = objConn.Execute(strBase & strFilter & strAttrs & strScope)
objRS.MoveFirst
While Not objRS.EOF
Wscript.Echo objRS.Fields(0).Value
objRS.MoveNext
Wend