2012-11-08 21 views

回答

2

According to this,AD LDS角色是驻留在您的LDS实例的CN=Roles容器中的AD组 - 对吗?

随着在System.DirectoryServices.AccountManagement(S.DS.AM)命名空间中的类,你可以得到这些团体很容易:

// set up the "ApplicationDirectory" context and use the "CN=Roles" container 
PrincipalContext ctx = new PrincipalContext(ContextType.ApplicationDirectory, "ldsserver:389", "CN=Roles,DC=YourCompany,DC=com"); 

// set up a "QBE" group principal 
GroupPrincipal qbeGroup = new GroupPrincipal(ctx); 

// create your principal searcher passing in the QBE principal  
PrincipalSearcher srch = new PrincipalSearcher(qbeGroup); 

// find all matches 
foreach(var found in srch.FindAll()) 
{ 
    // do whatever here - "found" should be "GroupPrincipal" types only 
} 

阅读所有关于System.DirectoryServices.AccountManagement(S.DS.AM)命名空间位置:

新的S.DS.AM可以很容易地与AD(和AD LDS)中的用户和群组玩耍!