久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

從 AD 域中獲取所有用戶

Get all users from AD domain(從 AD 域中獲取所有用戶)
本文介紹了從 AD 域中獲取所有用戶的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我需要能夠識別我的 AD (Active Directory) 域中的所有用戶.我有域名,僅此而已.如果我可以將它作為 UserPrincipal 或其他東西的列表來獲取它會很震撼,但如果它只是一個字符串,那么我可以從那里獲取我需要的其余信息.

I have a need to be able to identify all of the users on my AD (Active Directory) domain. I have the domain name and that is about it. It would rock if i could get it as a list of UserPrincipal or something but if its just a string then i can get the rest of the info i need from there.

謝謝!

推薦答案

如果你只需要獲取用戶列表你可以使用這個代碼 -

If you just have to get the users list you can use this code -

var dirEntry = new DirectoryEntry(string.Format("LDAP://{0}/{1}", "x.y.com", "DC=x,DC=y,DC=com"));
var searcher = new DirectorySearcher(dirEntry)
         {
             Filter = "(&(&(objectClass=user)(objectClass=person)))"
         };
var resultCollection = searcher.FindAll();

但是,如果您需要對 AD 進行更多操作,則應考慮使用 LINQ to AD API http://linqtoad.codeplex.com/

However if you have to more operations with AD you should consider using LINQ to AD API http://linqtoad.codeplex.com/

它是一個基于 Linq 的 API,用于處理 AD.易于使用,我用它取得了一些不錯的結果.

It is a Linq based API to work with AD. Easy to use and I have got some good results with it.

這篇關于從 AD 域中獲取所有用戶的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Why shouldn#39;t I always use nullable types in C#(為什么我不應該總是在 C# 中使用可空類型)
C# HasValue vs !=null(C# HasValue vs !=null)
C# ADO.NET: nulls and DbNull -- is there more efficient syntax?(C# ADO.NET:空值和 DbNull —— 有沒有更高效的語法?)
How to set null value to int in c#?(如何在c#中將空值設置為int?)
How to handle nulls in LINQ when using Min or Max?(使用 Min 或 Max 時如何處理 LINQ 中的空值?)
Method call if not null in C#(在 C# 中如果不為 null 的方法調用)
主站蜘蛛池模板: 国产黄视频在线观看 | 久久久久久av | 成人激情视频在线观看 | 中国av在线 | 日本国产视频 | 欧美视频在线观看 | 黄色一级毛片 | 五月婷婷在线视频 | 国产午夜精品福利 | 久久av在线| 久久久www成人免费精品 | 天堂在线中文资源 | 日日操夜夜爽 | 日本黄色三级视频 | 黄色小视频免费观看 | aaa国产精品 | 欧美成人精品欧美一级乱黄 | 人人草人人爽 | 中文字幕在线视频播放 | 免费成人小视频 | 操操操干干干 | 中文字幕黄色片 | 欧美三级a做爰在线观看 | 日日日操 | 99一区二区三区 | 国产精品偷乱一区二区三区 | 深夜福利网址 | 日本成人网址 | 欧美黄色一级大片 | 在线观看福利影院 | 欧美a级成人淫片免费看 | 人人看人人草 | 日本精品久久 | 天天色影院 | 午夜99 | 亚洲国产精品久久久久 | 亚洲狠狠爱 | 午夜视频一区 | 国产精品视频专区 | 国产又粗又猛视频免费 | 激情六月天 |