我正在使用 ASP.net 和 C#,并且对 Active Directory 知之甚少。我接到一项任务,按以下步骤编写程序:
ASP.net 应用程序被赋予用户的用户名。
应用程序应查询具有给定用户名的用户的所有组。
然后,应用程序应将这些组显示在两个单独的列表中,一个列表包含通讯组,另一个列表包含其余组。
现在,查询所有组就很容易了。但是如何检查该组是否在通讯组中呢?
我没有得到更多信息。
有什么属性或者我可以检查的东西吗?
您可以从名为的属性中检索此信息集团型 http://msdn.microsoft.com/en-us/library/windows/desktop/ms675935%28v=VS.85%29.aspx(最后一行)。
(0x00000001) : Specifies a group that is created by the system.
(0x00000002) : Specifies a group with global scope.
(0x00000004) : Specifies a group with domain local scope.
(0x00000008) : Specifies a group with universal scope.
(0x00000010) : Specifies an APP_BASIC group for Windows Server Authorization Manager.
(0x00000020) : Specifies an APP_QUERY group fir Windows Server Authorization Manager.
(0x80000000) :Specifies a security group. If this flag is not set, then the group is a distribution group.
您可以在这个答案 https://stackoverflow.com/questions/6252819/find-recursive-group-membership-active-directory-using-c-sharp/6289205#6289205或者在底部另一个 https://stackoverflow.com/questions/7648692/can-i-match-a-user-to-a-group-accross-different-domains/7794945#7794945检索用户所属组的不同方法。
你可以找到here https://stackoverflow.com/questions/6864582/asp-net-get-data-from-ad-about-user/6864697#6864697如何检索用户。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)