Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to Query Microsoft AD with Python 3

Two part question:

  1. What is the "best" way to query Microsoft AD with Python 3.x? With "best" defined as multi-OS support and use of core Python libraries preferable.

  2. Examples of querying AD structure for members of a specific AD group would be extremely appreciated.

I've looked at a few different libraries, but had issues loading them under OS X, Python 3, etc. Hoping someone's already looked at this issue.

like image 259
netmanchris Avatar asked Mar 11 '15 13:03

netmanchris


1 Answers

You can try the ldap3 package from Pypi at https://pypi.python.org/pypi/ldap3. It strictly follows the latest rfc for LDAP and is a pure Python implementation so can be used on different platforms, either with Python 2 (2.6 or 2.7) or Python 3

Disclaimer: I'm the author of the ldap3 library.

like image 197
cannatag Avatar answered Oct 01 '22 06:10

cannatag