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

Active Directory 嵌套組

Active Directory nested groups(Active Directory 嵌套組)
本文介紹了Active Directory 嵌套組的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個 C# 4.0 程序可以檢索特定 AD 組的所有成員.在這個 AD 組中是包含其他成員的其他 AD 組.我需要我的程序來識別它是一個組并檢索該組中的成員.

I have a C# 4.0 program working that retrieves all the members for a specific AD group. In this AD group are other AD groups containing other members. I need my program to identity that it is a group and retrieve the members in that group.

我知道我需要編寫一個遞歸程序,但我希望有人可能已經完成了.如果不是,有人可以告訴我 AD 屬性屬性來標識該成員是實際的組嗎?

I know I need to write a recursive program but I was hoping somebody out there might have already done it. If not, could somebody tell me the AD property attribute to identify that the member is actual a group?

推薦答案

由于您使用的是 .NET 3.5 及更高版本,您應該查看 System.DirectoryServices.AccountManagement (S.DS.AM) 命名空間.在此處閱讀所有相關信息:

Since you're on .NET 3.5 and up, you should check out the System.DirectoryServices.AccountManagement (S.DS.AM) namespace. Read all about it here:

  • 管理目錄.NET Framework 3.5 中的安全主體
  • 有關 System.DirectoryServices.AccountManagement 的 MSDN 文檔

基本上,您可以定義域上下文并輕松找到 AD 中的用戶和/或組.另外:GroupPrincipal 有一個名為 GetMembers 的方法,它將列出該組的所有成員 - 可選地,它會為您遞歸地這樣做!

Basically, you can define a domain context and easily find users and/or groups in AD. Also: the GroupPrincipal has a method called GetMembers which will list all members of that group - optionally, it will do so recursively for you!

// set up domain context
PrincipalContext ctx = new PrincipalContext(ContextType.Domain);

// find the group you're interested in
GroupPrincipal myGroup = GroupPrincipal.FindByIdentity(ctx, "SomeGroup");

// if you found it - get its members
if (myGroup != null)
{
   // if your call the GetMembers, you can optionally specify a "Recursive" flag - done here
   var allMembers = myGroup.GetMembers(true);
}

新的 S.DS.AM 使在 AD 中與用戶和組一起玩變得非常容易!

The new S.DS.AM makes it really easy to play around with users and groups in AD!

這篇關于Active Directory 嵌套組的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 | 久久久久久久久91 | 国产乱肥老妇国产一区二 | 男女羞羞网站 | 夜夜操天天干 | 一区在线免费视频 | 99精品视频一区二区三区 | 亚洲人成网站777色婷婷 | 欧美在线观看黄色 | aaa级片| www.久 | www.久久| 超碰在线国产 | 国产免费一区二区三区 | 理论片午午伦夜理片影院 | 精品一区国产 | 天天在线操 | 国产成人福利 | 91精品国产乱码久久蜜臀 | 99色视频| 国产99久久久久 | 在线亚洲免费 | 国产一区二区在线播放 | 中文字幕国产在线 | 国产免费一区二区三区免费视频 | 欧美成年人网站 | 中文字幕 欧美 日韩 | 日本福利视频免费观看 | 日本精品视频在线观看 | 国产在线对白 | 成人精品一区二区 | 国产成人在线免费 | 亚洲一区 | 91在线观| 日韩在线资源 | a在线视频 | 一区二区三区视频在线免费观看 | 国产大毛片 | 免费激情 | 久久99久久 | 欧美www在线观看 |