Hi,
I am having some trouble with querying the description field against groups from Active Directory. I get a Type mismatch. I guess that means it means this particular description field has been set up as an array and I am asking it to return it as a string. I can never find any MSDN pages on ADO "Active Directory Provider".
Below is my code. Changing to different fields, I have discovered the error is in
The odd thing is, I have another script that is similar - querying a different bunch of security groups, yet that doesn't error all though I ask for the description field.
I wonder if anyone would be able to confirm my suspicions or / and provide a solution to my issue.
Kind regards,
Woter
I am having some trouble with querying the description field against groups from Active Directory. I get a Type mismatch. I guess that means it means this particular description field has been set up as an array and I am asking it to return it as a string. I can never find any MSDN pages on ADO "Active Directory Provider".
Below is my code. Changing to different fields, I have discovered the error is in
Code:
objRS.Fields("Description").Value
Code:
Set objRootDSE = GetObject("LDAP://RootDSE")
strDNSDomain = objRootDSE.Get("defaultNamingContext")
strBase = "<LDAP://"& strDNSDomain &">;"
strFilter = "(&(objectCategory=group)(cn=GG_*)(cn=*PRINT_USERS));"
strAttrs = "cn,description;"
strScope = "Subtree"
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("cn").Value & " " & objRS.Fields("Description").Value
objRS.MoveNext
Wend
The odd thing is, I have another script that is similar - querying a different bunch of security groups, yet that doesn't error all though I ask for the description field.
I wonder if anyone would be able to confirm my suspicions or / and provide a solution to my issue.
Kind regards,
Woter