Hi Mark,
 
first thing which comes to my eyes is that the base it not started and ended with "<" and ">", but the whole query including base, filter and scope is.
 
So what I'd try is modifying the line beginning with strBase with
 
and the line starting with set objRS with
Set ObjRS = objConn.Execute("<" & strBase & strFilter & strScope & ">")
 
HTH, Ulf


Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Creamer, Mark
Gesendet: Freitag, 30. April 2004 22:31
An: [EMAIL PROTECTED]
Betreff: [ActiveDir] help querying for groups

Hi, can someone help me troubleshoot this script? I’m trying to return all of the global groups in the domain whose name starts with RPT. All I’m getting is the error: “Provider: Unspecified error”

 

strBase = "<LDAP://dc=my,dc=domain,dc=com>;"

strFilter = "(&(objectCategory=group)(name=RPT*));"

strScope = "Subtree"

 

Set objConn = CreateObject("ADODB.Connection")

objConn.Open "Provider=ADsDSOObject"

Set ObjRS = objConn.Execute(strBase & strFilter & strScope)

objRS.MoveFirst

While Not ObjRS.EOF

     WScript.Echo objRS.Fields(0).Value

     objRS.MoveNext

Wend

 

I’m trying to do this by altering one of the recipes in Robbie Allen’s book. Thanks!

 

Mark Creamer

Systems Engineer

Cintas Corporation

Honesty and Integrity in Everything We Do

 

Reply via email to