MrMistreater

Get list of local domains

May 15th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.24 KB | None | 0 0
  1. DirectoryEntry root = new DirectoryEntry("WinNT:");
  2. foreach (DirectoryEntry dom in root.Children) {
  3.   foreach (DirectoryEntry entry in dom.Children) {
  4.     if (entry.Name != "Schema") {
  5.       Console.WriteLine(entry.Name);
  6.     }
  7.   }
  8. }
Advertisement
Add Comment
Please, Sign In to add comment