tags:

views:

64

answers:

1

Hello,

I need to list all Active Directory group's members - can I do this without using LDAP queries with PyWin's win32security, for instance?

I can lookup accounts' sids and names using it (LookupAccountSid and LookupAccountName), but how about getting all group members? For now I cannot figure out what functions I should use.

I have account SID as an input parameter and its Domain name.

Thanks!

+1  A: 

This active directory module wraps an interface around win32com.client.

active_directory - a lightweight wrapper around COM support for Microsoft's Active Directory

Active Directory is Microsoft's answer to LDAP, the industry-standard directory service holding information about users, computers and other resources in a tree structure, arranged by departments or geographical location, and optimized for searching.

There are several ways of attaching to Active Directory. This module uses the Dispatchable LDAP:// objects and wraps them lightly in helpful Python classes which do a bit of the otherwise tedious plumbing. The module is quite naive, and has only really been developed to aid searching, but since you can always access the original COM object, there's nothing to stop you using it for any AD operations.

Mark
thank you - will try this!
dmitko