Active Directory and ActivePython2.1

alan runyan runyaga at
Sat Nov 10 04:42:27 CET 2001

I'm trying to use ldap search filters w/ Python against Active Directory and
things are jiving.  I can get it to work w/ ASP no problem.  All help would
be *greatly* appreciated.

my problemed Python Script
    adsi = win32com.client.Dispatch('ADsNameSpaces')
    ldap=adsi.getobject('', 'LDAP:')
    myDSObject = ldap.OpenDSObject(ldapQuery,'username','password', 1)

I get:
Traceback (most recent call last):
  File "E:\Python21\Pythonwin\pywin\framework\", line 301, in
    exec codeObject in __main__.__dict__
  File "E:\ZOPE\Extensions\", line 37, in ?
  File "<COMObject <unknown>>", line 2, in OpenDSObject
com_error: (-2147352567, 'Exception occurred.', (0, 'Active Directory',
'Unspecified error\r\n', None, 0, -2147467259), None)

in VBScript/ASP

      Set conn = server.createobject("ADODB.Connection")
      conn.Provider = "ADSDSOObject"
      conn.Open "ADs Provider"
      Set rs =

am I doing some glaringly wrong?

any comments greatly appreciated

More information about the Python-list mailing list