Python and Active Directory

Mark Hammond mhammond at
Fri Mar 10 10:54:42 CET 2000

"Augustine David" <augustine_david at> wrote in message
news:t8Yx4.1012$Qf.532452 at

> I am attempting to reproduce the SDK examples below in Python.  I
have ran
> "makepy" on the type library,
> but I am unsure how to call any of its classes using
> "win32com.client.Dispatch".  Any input you can give me
> would be appreciated.

This is a little painful unfortunately.  Note the second line - this
is necessary to force the constant ADS_SECURE_AUTHENTICATION into the
COM constants namespace.   This second line was generated by running
" -i".  Otherwise you could just use the literal constant 1
:-)  Normally the constants are "magically" loaded by the time you
need them, but not in this case.

This requires build 128 of win32all.  Also I cant make it work, but I
think I simply can't get the strings correct (Ive struggled with this
before :-(

from win32com.client import gencache, GetObject, constants
gencache.EnsureModule('{97d25db0-0363-11cf-abc4-02608c9e7553}', 0, 1,

np = GetObject("LDAP:")
                     "", "",
-- eof


More information about the Python-list mailing list