2

私は、Exchange Serverに関する詳細情報を取得するために使用されるLDAPクエリについて知りたいと思っていました。 データ可用性グループ、それらに関する統計、レプリケーションステータスなどを知りたいと思っています CmdLetsがいくつかありますが、私はPowerShellの使用を避けたいと思います。ADからLDAPクエリを使用してMS Exchange Server 2010からDAG情報を取得する方法は?

Exchange Server用のActive Directoryから同じ情報を取得する方法を知りたい。

+2

あなたはPowerShellをしたくない場合は、それはそれのためのタグを削除するのが最善かもしれません;) –

+0

はあなたが盗んしたい情報の詳細を与えることができますか?そして、あなたが使いたくないCmdLetsを与えるかもしれません。 – JPBlanc

+0

@JBlanc、私はGet-DataAvalabililtyGroup、Get-DataAvailabilityGroupNetworkなどのようなコマンドレットを知っています。しかし何らかの理由で私はLDAPを使ってADから同じ情報を取得したいのです。 どうすればいいですか? – 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(); 
    } 
関連する問題