dsget用什么来查询目录?

发布于 2024-12-27 20:12:32 字数 389 浏览 0 评论 0原文

我所在的组织的 Active Directory 具有非常深的嵌套组结构。我想查询目录以从 Linux 计算机递归查找组的用户成员。在 Windows 机器上,

dsget group "dn_of_group" -members -expand

完全按照我的要求做,而且做得非常快。当我尝试通过 LDAP 获得相同的结果时,

(memberOf:1.2.840.113556.1.4.1941:=dn_of_group)

查询需要运行近一分钟。 dsget 在幕后使用 LDAP 还是使用其他方式来查询目录?如果是这样,我有什么办法也可以使用它吗?

编辑: 澄清我需要作为用户的成员。

I am in an organization with an Active Directory with a very deep nested group structure. I would like to query the directory to recursively find user members of a group from a Linux machine. On a Windows machine,

dsget group "dn_of_group" -members -expand

does exactly what I want and does it very quickly. When I tried to get the same results via LDAP with

(memberOf:1.2.840.113556.1.4.1941:=dn_of_group)

the query takes almost a minute to run. Does dsget use LDAP under the hood or does it use some other means to query the directory? And if so, is there any way for me to also use that?

Edit:
Clarified that I need the members which are users.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

囚你心 2025-01-03 20:12:32

Framework 3.5 与 System.DirectoryServices.AccountManagement 命名空间提供了一种搜索方法递归所有组并返回用户所属的组。返回的组还可以包括系统出于授权目的将用户视为其成员的附加组。

UserPrincipal.GetAuthorizationGroups()

此方法返回的组可能包括来自与主体不同范围和存储的组。例如,如果主体是 DN 为“CN=SpecialGroups,DC=Fabrikam,DC=com”的 AD DS 对象,则返回的集可以包含属于“CN=NormalGroups,DC=Fabrikam,DC=”的组。 com


在另一个方向你有:

GroupPrincipal.GetMembers(bool recursive)

请参阅备注

The framework 3.5 with System.DirectoryServices.AccountManagement Namespace provides a method that searches all groups recursively and returns the groups in which the user is a member. The returned set may also include additional groups that system would consider the user a member of for authorization purposes.

UserPrincipal.GetAuthorizationGroups()

The groups that are returned by this method may include groups from a different scope and store than the principal. For example, if the principal is an AD DS object that has a DN of "CN=SpecialGroups,DC=Fabrikam,DC=com, the returned set can contain groups that belong to the "CN=NormalGroups,DC=Fabrikam,DC=com


In the other direction you've got :

GroupPrincipal.GetMembers(bool recursive)

See Remarks

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文