Question:
I use the code found at http://support.microsoft.com/kb/306273
to add a windows user. The problem is i need to add the user to a group, but the gro
This page has some code for getting user details and checking them.
This code:
public IdentityReferenceCollection GetUserGroups()
{
System.Security.Principal.WindowsIdentity currentUser =
System.Security.Principal.WindowsIdentity.GetCurrent();
return currentUser.Groups;
}
returns the current user's groups.
More details on the WindowsIdentityclass as a whole can be found here, with the Groups property here.