What is the easiest way to get the primary groupName from AD in C#?

Posted by madhatter84gn on Stack Overflow See other posts from Stack Overflow or by madhatter84gn
Published on 2010-04-30T13:54:30Z Indexed on 2010/04/30 13:57 UTC
Read the original article Hit count: 373

Filed under:
|
|
|
|

I am currently using PrincipalContext and UserPrincipal to return the users primary groupid.

How can I take this id and find the actual group name?

Also I have code that works correctly to assign the user's primary group, but once I assign them to the group I can not delete them from Domain Users which is the default primary group prior to my change. I have called Save() before trying to remove the domain users group.

My requirements state I must add the user to AD then assign their primary group and then remove them as a member of Domain Users.

© Stack Overflow or respective owner

Related posts about c#

Related posts about ad