AD に Universal Distribution グループがあります。Exchange では、すべてのユーザーがグループに自分自身を追加またはグループから削除できるように、グループを公開するように設定しました。
C# には、次のコードがあります。
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, "Domain.com");
GroupPrincipal group = GroupPrincipal.FindByIdentity(ctx, groupName);
UserPrincipal userP = UserPrincipal.FindByIdentity(ctx, User.Identity.Name);
group.Members.Add(userP);
group.Save();
group.Save();
原因UnathorizedAccessException
a .
すべてのユーザーがこのアクションを実行できるようにするには、どの設定を変更する必要がありますか?