Guest User

Untitled

a guest
Feb 25th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. using (DirectoryEntry machine = new DirectoryEntry("WinNT://" + serverName))
  2. {
  3. //get local admin group
  4. using (DirectoryEntry group = machine.Children.Find("Administrators", "Group"))
  5. {
  6. //get all members of local admin group
  7. var members = (IEnumerable)group.Invoke("Members", null);
Add Comment
Please, Sign In to add comment