PrincipalContext context = new PrincipalContext(ContextType.Domain, "ipofmachine", "DC=xyz,DC=org", "username", "Password");
UserPrincipal userPrinciple = UserPrincipal.FindByIdentity(context, "User0");
var groups = userPrinciple.GetAuthorizationGroups();
if (userPrinciple != null)
{
foreach (GroupPrincipal gp in groups)
{
//some thing
}
}
私が与える必要がある許可はありますか?一部のブログで、SID 履歴を含めるように設定されているユーザーがいない場合、これは正常に機能することを知りました (ただし、グループの sid 値は編集できないと思います)。