Seaching Active Directory via ADO

LittlePython LittlePython at lost.com
Thu Feb 16 21:18:13 EST 2006


To be more clear, something like this example but in python. I have tryed to
convert something very simular to this
but have failed.

 ------ SCRIPT CONFIGURATION ------
strBase    =  "<LDAP://<BaseDN>>;"
strFilter  = "<Filter>;"
strAttrs   = "<AttrList>;"
strScope   = "<Scope>"
' ------ END CONFIGURATION ---------

set objConn = CreateObject("ADODB.Connection")
objConn.Provider = "ADsDSOObject"
objConn.Open "Active Directory Provider"
set objComm = CreateObject("ADODB.Command")
objComm.ActiveConnection = objConn
objComm.Properties("Page Size") = 1000
objComm.CommandText = strBase & strFilter & strAttrs & strScope
set objRS = objComm.Execute
objRS.MoveFirst
while Not objRS.EOF
    Wscript.Echo objRS.Fields(0).Value
    objRS.MoveNext
wend




"LittlePython" <LittlePython at lost.com> wrote in message
news:g_7Jf.33401$0H1.22606 at trnddc04...
> I am have trouble finding a simple working example of  using ADO to search
> Active Directory. I am hoping someone could point me to a generic working
> script that connects to AD and pulls up a recordset to help me get started
> into the right direction in learning ADO, ADSI on Python.
>
>





More information about the Python-list mailing list