[英]Get the list of ADS groups of the currently logged in user using C#
我是编程的初学者,我想使用C#获取用户的广告组列表。 如果您的答案很详细,将会更有帮助。
我几个月前已经做到了,但是手头没有代码。 也许以后我可以检查一下,但这大概是它的工作方式:
UserPrincipal up = UserPrincipal.Current;
foreach (GroupPrincipal gp in up.GetGroups())
{
// do something with it, like reading out gp.Name
}
希望能帮助到你。 此外,添加System.DirectoryServices
程序集
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.