I am querying LDAP to get child objects. I'd like to only get group objects but my query returns all children objects. What is my query missing
The query returns
CN=Group1,OU=Groups,DC=xxx,DC=xxx,DC=xxx
CN=Group2,OU=Groups,DC=xxx,DC=xxx,DC=xxx
CN=User1,OU=User,DC=xxx,DC=xxx,DC=xxx
but would like
CN=Group1,OU=Groups,DC=xxx,DC=xxx,DC=xxx
CN=Group2,OU=Groups,DC=xxx,DC=xxx,DC=xxx
I could script this output but would prefer to get it from a query.
-Geates
"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom
"I do not offer answers, only considerations."
- Geates's Disclaimer
Code:
set objCommand = CreateObject("ADODB.Command")
set objConnection = CreateObject("ADODB.Connection")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
objCommand.ActiveConnection = objConnection
strQuery = [red]"SELECT Member FROM
'LDAP://OU=Groups,DC=xxx,DC=xxx,DC=xxx' WHERE objectCategory='group' AND cn='vmview'"[/red]
objCommand.CommandText = strQuery
set objRecordSet = objCommand.Execute
The query returns
CN=Group1,OU=Groups,DC=xxx,DC=xxx,DC=xxx
CN=Group2,OU=Groups,DC=xxx,DC=xxx,DC=xxx
CN=User1,OU=User,DC=xxx,DC=xxx,DC=xxx
but would like
CN=Group1,OU=Groups,DC=xxx,DC=xxx,DC=xxx
CN=Group2,OU=Groups,DC=xxx,DC=xxx,DC=xxx
I could script this output but would prefer to get it from a query.
-Geates
"I hope I can chill and see the change - stop the bleed inside and feel again. Cut the chain of lies you've been feeding my veins; I've got nothing to say to you!"
-Infected Mushroom
"I do not offer answers, only considerations."
- Geates's Disclaimer