0
我可以通過以下方式查詢用戶,但是我想向搜索DN添加額外的OU = Good。這可能沒有硬編碼GC的完整路徑?如何從GlobalCatalog添加OU
Forest myForest = Forest.GetCurrentForest();
GlobalCatalog cat = myForest.FindGlobalCatalog();
DirectorySearcher srch = cat.GetDirectorySearcher();
srch.Filter = "(&(objectClass=user)(samaccountname=myuser))";
SearchResult result = srch.FindOne();