Adding to AD group with ASP and AccountManagement namespace
Posted on 2011-02-25
I wan to use the following code as a template to add user to a particular group in AD. The problem I'm encountering is how to add to an OU group that has the same name as others. For example, Users in Miami in Florida in US versus Users in Madrid in Spain. Thanks.
GroupPrincipal grp = GroupPrincipal.FindByIdentity(ctx,
if (grp != null)
grp.Members.Remove(ctx, IdentityType.Name, "John Smith");
grp.Members.Add(ctx, IdentityType.Name, "Jim Daly");