linux - 从 Windows 或 Linux 设备使用 Python 2.7 查询 Windows Active Directory

标签 linux windows python-2.7 active-directory dsquery

我需要编写一些可以在 Windows 或 Linux 上运行的代码,我可以使用这些代码来查询用户或计算机的 Windows Active Directory 域。查询将相对较小。我习惯在 Windows 上使用 DSQUERY 处理此类问题,但我需要跨平台的解决方案并用 Python 2.7 编写。

我在网上看到了一些例子,但我读到的所有内容都涉及在 Linux 上安装 LDAP 代码以使其工作(这对我来说真的不是一个选择,因为我不会拥有主机代码将正在运行)。

我还找到了 PYAD 库,但据我所知,它依赖于 Windows 机器并安装了 PYWIN32。

理想情况下,我想要一段可以在任一架构上运行的代码。

我并不是真的在寻找代码示例本身(但如果你想放弃一些我没意见),但我想我真的只需要一个线索。

提前致谢

最佳答案

不幸的是,LDAP 将是您最好的选择。来自 Protocols and Interfaces to Active Directory ,它指出:

Core protocol that is supported by Active Directory, as described in RFC 2251 (LDAPv3) and RFC 1777 (LDAPv2).

python-ldap api 跨多个平台工作。

可以看到Active Directory支持的所有协议(protocol)here .

关于linux - 从 Windows 或 Linux 设备使用 Python 2.7 查询 Windows Active Directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35822329/

相关文章:

numpy - 在周期性条件下切片numpy数组

ruby-on-rails - rails 使用用户输入运行 shell 命令

从 shell 调用 python 脚本时不执行

c++ - VirtualQueryEx 错误 - 页面太多

python - 错误 : command 'gcc' failed: No such file or directory

python - Kivy 小部件隐藏在 Windows 标题栏下

python - BeautifulSoup,简单的正则表达式问题

cygwin - Python 2.7.2,Cygwin,raw_input : why does it only print the prompt after I give the input?

linux - 编译器版本

c - 如何在 C 中多次调用 sem_open?