gpt4 book ai didi

python - 使用 PyWin32 获取 Active Directory 组成员

转载 作者:太空宇宙 更新时间:2023-11-04 01:42:18 28 4
gpt4 key购买 nike

我需要列出所有 Active Directory 组的成员 - 例如,我可以在不使用 PyWin 的 win32security 的 LDAP 查询的情况下做到这一点吗?

我可以使用它(LookupAccountSidLookupAccountName)查找帐户的 sids 和名称,但是获取所有组成员怎么样?现在我不知道我应该使用什么功能。

我将帐户 SID 及其域名作为输入参数。

谢谢!

最佳答案

active directory模块围绕 win32com.client 包装了一个接口(interface)。

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.

关于python - 使用 PyWin32 获取 Active Directory 组成员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3726811/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com