Re: Add ActiveDirectory user to Global Security Group

Tech-Archive recommends: Speed Up your PC by fixing your registry



I am struggling with a problem, i want to add ActiveDirectory user to
Global Security Group using C# and DirectoryServices. Any suggestiion

1) Bind to the group in question.

DirectoryEntry group = new
DirectoryEntry("LDAP://cn=MyGroup,ou=SomeOU,dc=company,dc=com";);

2) Call the .Add method on the "member" property of the group,
specifying the user to add with its distinguishedName

group.Properties["member"].Add("cn=Joe
User,ou=Research,ou=HQ,dc=company,dc=com");

3) Call .CommitChanges on the group to commit the changes to the store

group.CommitChanges();


Done!

Marc
.