2014-11-21 2 views
0

Exchange 사서함 개체의 DirectoryEntry 속성 목록이 있는지 알려 줄 수 있습니까?Exchange 사서함 DirectoryEntry 속성 목록

// create your domain context 
PrincipalContext ctx = new PrincipalContext(ContextType.Domain, ConfigurationManager.AppSettings["ADDomain"].ToString(), ConfigurationManager.AppSettings["ADUser"].ToString(), ConfigurationManager.AppSettings["ADPassword"].ToString()); 

// define a "query-by-example" principal - here, we search for all users 
UserPrincipalEXT qbeUser = new UserPrincipalEXT(ctx); 

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

// find all matches 
foreach (var found in srch.FindAll()) 
{ 
    if (found.GetUnderlyingObjectType() == typeof(DirectoryEntry)) 
    { 
     DirectoryEntry de = (DirectoryEntry)found.GetUnderlyingObject(); 
    }     
} 

내가 필요로하는 속성의 이름을 찾기 위해 애 쓰고 있어요 ...

감사합니다 :

여기 내 코드의 샘플입니다!

답변

1

DirectoryEntry.PropertiesPropertyCollection입니다. 속성을 열거하는 데 사용할 수있는 PropertyNames 같은 속성을 제공합니다.

foreach (var name in de.Properties.PropertyNames) 
{ 
    Console.WriteLine(name); 
} 
+0

내 친구 감사합니다! 매력처럼 작동 :) –

관련 문제