[python-win32] Wanted to get many kind of infos through Active directory.

Khalid MOULFI farplagek at gmail.com
Tue Apr 1 16:00:58 CEST 2008


Dear all,

we have an active directory on win2000. We use Python 2.2.1.
As more and more infos are in our AD, I would like to manage this AD
database using Python scipts (Who are there?Which group?Create users?...)
I used scripts of TJG (Tim) and I had the following :

import active_directory

me = active_directory.AD_object ("LDAP://OU=Service Point 17,OU=Unprivileged
Users,OU=OSUsers,OU=OSDirectory,DC=toto,DC=fr")

me = active_directory.AD_object (GetObject
("LDAP://OU=place1,OU=Unprivileged
Users,OU=OSUsers,OU=OSDirectory,DC=toto,DC=fr"))

#
# Historical method
#
me = active_directory.AD_object (path="LDAP://OU=place1,OU=Unprivileged
Users,OU=OSUsers,OU=OSDirectory,DC=toto,DC=fr")
============================================================================================================================================
but i have :

Traceback (most recent call last):
  File "tyty.py", line 3, in ?
    me = active_directory.AD_object ("LDAP://OU=Service Point
17,OU=Unprivileged Users,OU=OSUsers,OU=OSDirectory,DC=toto,DC=fr")
  File "C:\Documents and
Settings\khalid\Desktop\Python\modules\active_directory.py", line 263, in
__init__
    schema = GetObject (self.com_object.Schema)
AttributeError: 'str' object has no attribute 'Schema'
>Exit code: 1

this test has been done with active_directory version 0.4

and with active_directory version 0.6.7 I have he following error :

Traceback (most recent call last):
  File "tyty.py", line 1, in ?
    import active_directory
  File "C:\Documents and
Settings\khalid\Desktop\Python\modules\active_directory.py", line 361
    return set (name for (bitmask, name) in enum.item_numbers () if item &
bitmask)
                       ^
SyntaxError: invalid syntax


If anyone can help thanks in advance,

Regards,

Khalid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20080401/4a885e52/attachment.htm 


More information about the python-win32 mailing list