第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

GetAllUsers 問題,忽略從屬 OU

GetAllUsers 問題,忽略從屬 OU

C#
臨摹微笑 2022-06-12 11:09:36
我試圖為我的公司制作一個 Active-Directory 管理工具,我想從特定的 OU 中獲取所有用戶,而不是得到 under(?)-OU 的結(jié)果。結(jié)構(gòu)是這樣的:->XXXX.de-->Germany--->Users (Here are the Users i want to get)(These are the unnecessary OUs / Results)----> Administrative accounts----> Other Accounts我的 DirectorySearcher 的 LDAP 鏈接 (ldapPath) 是"LDAP://OU=Users,OU=Germany,DC=XXXX,DC=de".代碼:public SearchResultCollection getAllUsers(string location){    string ldapPath;    SearchResultCollection allResults;    try {        ldapPath = getLdapPathFromLocation(location);        DirectoryEntry entry = createDirectoryEntry(AD_BWFE, ldapPath);        DirectorySearcher searcher = new DirectorySearcher(entry);        searcher.PropertiesToLoad.Add("cn");        searcher.PropertiesToLoad.Add("sAmAccountName");        allResults = searcher.FindAll();        return allResults;    }
查看完整描述

1 回答

?
慕沐林林

TA貢獻(xiàn)2016條經(jīng)驗 獲得超9個贊

配置DirectorySearcher使其專門在UsersOU 中搜索,然后將SearchScope屬性指定為SearchScope.OneLevel(默認(rèn)為SubTree)。

不幸的是,唯一允許您同時指定兩者的構(gòu)造函數(shù)重載是廚房水槽構(gòu)造函數(shù)。


查看完整回答
反對 回復(fù) 2022-06-12
  • 1 回答
  • 0 關(guān)注
  • 131 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號