I have code for getting members of administrators of local group examples
private void GetUserGrps()
{
using (DirectoryEntry groupEntry = new DirectoryEntry("WinNT://./Administrators,group"))
{
foreach (object member in (IEnumerable)groupEntry.Invoke("Members"))
{
using (DirectoryEntry memberEntry = new DirectoryEntry(member))
{
new GUIUtility().LogMessageToFile(memberEntry.Path);
}
}
}
Is there a way to get the groups to which the local user belongs using directory services?
Without using Active Directory or a domain in it, because I want only for the local computer, not for the domain.
source
share