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

從 AD 域中獲取所有用戶

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

問題描述

我需要能夠識別我的 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 進行更多操作,則應(yīng)考慮使用 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.易于使用,我用它取得了一些不錯的結(jié)果.

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

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

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

相關(guān)文檔推薦

Why shouldn#39;t I always use nullable types in C#(為什么我不應(yīng)該總是在 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#中將空值設(shè)置為int?)
How to handle nulls in LINQ when using Min or Max?(使用 Min 或 Max 時如何處理 LINQ 中的空值?)
Method call if not null in C#(在 C# 中如果不為 null 的方法調(diào)用)
主站蜘蛛池模板: 99久久精品国产一区二区三区 | 一级黄色片毛片 | 日本成人久久 | 欧美三区视频 | 亚洲午夜精品久久久久久app | 免费观看一级毛片视频 | 久久精品国产一区 | 久久这里有精品 | 日韩精品一区二区不卡 | 白浆在线 | 成人av在线大片 | 久久久激情视频 | 超碰97免费在线 | 欧美精品成人一区二区三区四区 | 成年人免费看的视频 | 99re超碰| 男人的天堂久久 | 国产精品久久亚洲7777 | 中国黄色在线视频 | 欧美一区成人 | 精品国产伦一区二区三区观看体验 | 国产精品精品3d动漫 | 一区二区三区国产精品 | 91精品国产91久久久久久最新 | 亚洲午夜精品视频 | 爱草视频 | 日韩高清av | 伊人久久精品一区二区三区 | 精品欧美视频 | 国产免费看| 国内精品免费久久久久软件老师 | 成人国产精品久久 | 希岛爱理在线 | 成人免费视频观看视频 | 欧美日韩一本 | 一级做a爰片久久毛片 | 国产精品一区二区福利视频 | 久草资源网站 | 91社区在线观看高清 | 欧美精品一区二区三区在线播放 | 亚洲精品中文在线观看 |