これはすばらしいアイデアです!
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();
}
あなたはPowerShellをしたくない場合は、それはそれのためのタグを削除するのが最善かもしれません;) –
はあなたが盗んしたい情報の詳細を与えることができますか?そして、あなたが使いたくないCmdLetsを与えるかもしれません。 – JPBlanc
@JBlanc、私はGet-DataAvalabililtyGroup、Get-DataAvailabilityGroupNetworkなどのようなコマンドレットを知っています。しかし何らかの理由で私はLDAPを使ってADから同じ情報を取得したいのです。 どうすればいいですか? – Piyush