Get a list of members of a WinNT group (C#)

Posted by Keith Moore on Stack Overflow See other posts from Stack Overflow or by Keith Moore
Published on 2008-10-31T08:33:04Z Indexed on 2010/05/06 2:18 UTC
Read the original article Hit count: 534

There are a couple of questions similar to this on stack overflow but not quite the same.

I want to open, or create, a local group on a win xp computer and add members to it, domain, local and well known accounts. I also want to check whether a user is already a member so that I don't add the same account twice, and presumably get an exception.

So far I started using the DirectoryEntry object with the WinNT:// provider. This is going ok but I'm stuck on how to get a list of members of a group?

Anyone know how to do this? Or provide a better solution than using DirectoryEntry?

© Stack Overflow or respective owner

Related posts about c#

Related posts about windows-security