1
在我的應用程序中,我需要獲取Active Directory林並列出域層次結構。如何列出從非域計算機運行代碼的域?
我被授予了具有必要權限的Active Directory帳戶。但是,我的開發計算機不在域上,無法添加到域中。
這裏是我使用來獲取森林和訪問根域代碼:
// I also tried to add a Global Catalog port: 192.168.2.11:3268, no success
DirectoryContext dc = new DirectoryContext(
DirectoryContextType.Forest, "192.168.2.11", 「Login1」, 「pass1」);
Forest f = Forest.GetForest(dc);
Console.WriteLine("Forest name: " + f.Name);
Console.WriteLine("Root domain: " + f.RootDomain);
如何修改它來發現的情況下,域我是不是在一臺計算機上運行它域?