2

Exchange Server에 대한 자세한 정보를 얻는 데 사용되는 LDAP 쿼리에 대해 알고 싶었습니다. 데이터 가용성 그룹, 통계 및 복제 상태 등에 관한 자세한 내용을 알고 싶습니다. 일부 CmdLets가 있지만 PowerShell 사용을 피하고 싶습니다.AD에서 LDAP 쿼리를 사용하여 MS Exchange Server 2010에서 DAG 정보를 얻는 방법은 무엇입니까?

Exchange Server 용 Active Directory에서 동일한 정보를 가져 오는 방법을 알고 싶습니다.

+2

당신이 다음 PowerShell을하지 않으려면 그것의 태그를 제거하는 것이 가장 수 있습니다) –

+0

당신은 당신이 retreive 할 정보에 대한 자세한 내용을 주실 수 있습니까? 아마도 사용하고 싶지 않은 CmdLets를 제공하십시오. – JPBlanc

+0

@JBlanc, Get-DataAvalabililtyGroup, Get-DataAvailabilityGroupNetwork 등과 같은 cmdlet을 알고 있습니다. 그러나 어떤 이유로 LDAP에서 LDAP를 사용하여 동일한 정보를 가져오고 싶습니다. 어떻게 할 수 있습니까? – Piyush

답변

0

멋진 아이디어입니다!

CN = Microsoft Exchange CN = 서비스, CN = 구성, DC의 = xx에, 직류 = xx에 :

은 아래의 구성 파티션에있는 모든이있다.

아래의 C# 코드는 서버 역할을 검색하므로 시작하는 데 도움이됩니다.

역할 정보는 here에서 제공됩니다.

 using (DirectoryEntry de = new DirectoryEntry("LDAP://RootDSE")) 
     { 
      var NamingContext = de.Properties["configurationNamingContext"][0]; 
      using (DirectoryEntry de_NC = new DirectoryEntry("LDAP://" + NamingContext)) 
      { 
       using (DirectorySearcher ds = new DirectorySearcher(de_NC)) 
       { 
        ds.PropertiesToLoad.Add("cn"); 

        ds.Filter = "(&(objectCategory=msExchExchangeServer)(msExchCurrentServerRoles:1.2.840.113556.1.4.803:=2))"; 
        Output("Mailbox Role Servers:", ds, "cn"); 

        ds.Filter = "(&(objectCategory=msExchExchangeServer)(msExchCurrentServerRoles:1.2.840.113556.1.4.803:=4))"; 
        Output("CAS Role Servers:", ds, "cn"); 

        ds.Filter = "(&(objectCategory=msExchExchangeServer)(msExchCurrentServerRoles:1.2.840.113556.1.4.803:=16))"; 
        Output("Unified Messaging Role Servers:", ds, "cn"); 

        ds.Filter = "(&(objectCategory=msExchExchangeServer)(msExchCurrentServerRoles:1.2.840.113556.1.4.803:=32))"; 
        Output("Hub Transport Role Servers:", ds, "cn"); 

        ds.Filter = "(&(objectCategory=msExchExchangeServer)(msExchCurrentServerRoles:1.2.840.113556.1.4.803:=64))"; 
        Output("Edge Transport Role Servers:", ds, "cn"); 
       } 
      } 
     } 


    static void Output(string Titel, DirectorySearcher ds, string Property) 
    { 
     Console.WriteLine(Titel); 
     SearchResultCollection src = ds.FindAll(); 
     foreach (SearchResult RoleServer in src) 
     { 
      Console.WriteLine(RoleServer.Properties[Property][0].ToString()); 
     } 
     if (src.Count < 1) 
      Console.WriteLine("---"); 

     Console.WriteLine(); 
    }