hi all was wondering why this code is not working. I am trying to get an output of the "description" col in AD . It is giving me a current record set does not support the data
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, Location, description from 'LDAP://xx' " _
& "Where objectClass='computer'"
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
objRecordSet.Fields("description").Value = ""
arrDesc = objRecordSet.Fields("description").Value
If IsNull(arrDesc) Then
strDescription = ""
Else
For Each strLine In arrDesc
strDescription = strLine
Next
End If
Wscript.Echo "Computer Name: " & objRecordSet.Fields("Name").Value
Wscript.Echo "Location: " & objRecordSet.Fields("Location").Value
Wscript.Echo strName & ", " & strDescription
objRecordSet.MoveNext
Loop