Just Want to Learn
Just Want to Learn

Reputation: 31

C# Distribution list attributes (active directory)

Hi I'm trying to update my distribution lists menagers using LDAP And I need to know what is the attribute of the "manager can update membership list" checkbox I want only use c# NOT vbs or powershell I can update the menageby but I prefer that you write it for the exmple..

Upvotes: 1

Views: 373

Answers (1)

pbsask
pbsask

Reputation: 11

The simple answer is there is no attribute for the "Manager can update membership list" checkbox, the check box is a security setting. When you check it the security of the group is modified to include the manager with the required permissions, unticking removes the managers rights under the security tab to modify the group.

You can use the ObjectSecurity to see if a SID has a unique ACL entry, in a standard environment this should be enough. This code should give you an idea of how to do it.

NTAccount acc = new NTAccount(managersam); 
SecurityIdentifier sid = (SecurityIdentifier)acc.Translate(typeof(SecurityIdentifier)); 
ActiveDirectorySecurity sdc = YourGroupObject.ObjectSecurity; 
AuthorizationRuleCollection arc= sdc.GetAccessRules(true, false, Type.GetType("System.Security.Principal.SecurityIdentifier")); 
foreach (AuthorizationRule ar in arc) {
   if (ar.IdentityReference== sid
   {
     managercanedit= true;
   }
 }

Upvotes: 1

Related Questions