I'd like to retrieve all local groups on my machine (Vista in a W2k3 domain).
If I run:
using (DirectoryEntry de = new DirectoryEntry("WinNT://" + Environment.MachineName + ",group", null, null, AuthenticationTypes.Secure))
{
}
it throws an "unknown error" 0x80005000 which apparently means "invalid path"
However querying for computers (change ,group to ,computer) doesn't raise an error, but it seems to be ignored (it returns all objects? I haven't fully examined the result). ,user also raises the error.
So my question is, am I on the right path? is there a way to apply a filter so I don't retrieve everything? If so, where can I find the correct syntax?