使用 Python 3 查询 Microsoft AD 的最佳方式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28988072/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 03:58:40  来源:igfitidea点击:

Best way to Query Microsoft AD with Python 3

pythonpython-3.xactive-directory

提问by netmanchris

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.

  1. 使用 Python 3.x 查询 Microsoft AD 的“最佳”方法是什么?将“最佳”定义为多操作系统支持和使用核心 Python 库更可取。

  2. 将非常感谢为特定 AD 组的成员查询 AD 结构的示例。

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.

我看过几个不同的库,但是在 OS X、Python 3 等下加载它们时遇到问题。希望有人已经看过这个问题。

采纳答案by cannatag

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

您可以在https://pypi.python.org/pypi/ldap3尝试来自 Pypi 的 ldap3 包。它严格遵循 LDAP 的最新 rfc 并且是纯 Python 实现,因此可以在不同平台上使用,无论是 Python 2(2.6 或 2.7)还是 Python 3

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

免责声明:我是 ldap3 库的作者。