aduser Module¶
- class aduser.ADuser(username, ad_obj=None, attributes=None)[source]¶
Bases: object
An Active Directory-backed user-representation object.
Parameters: - username – sAMAccountName of the user.
- ad_obj (mldap2) – connected object.
- attributes – Dictionary to initiate with.
- Example:
>>> u = ADuser("wimpy", attributes={'mail': 'wimpy@wimpy.org', 'initial': 'w'})
Note
- __setattr__() is defined, so attribute changes
- will be made live if an ad_obj is provided.
- attr_map = {'distinguishedName': 'distinguishedName', 'username': 'sAMAccountName', 'firstname': 'givenName', 'lastname': 'sn', 'initial': 'initials', 'idno': 'employeeNumber', 'email': 'mail'}¶
attr_map should be moved. It documents a more general mapping to specific AD attributes.
- commit()[source]¶
commit back attribute changes to active directory .. note:: deprecated now that __setattr__ has been added.