Export and Compare Exchange 2010 Server Settings

With my next script you could export and then compare almost all Exchange 2010 server settings between different servers in your exchange org – considered are HUB, CAS, Mailbox Server Roles and DAG. Script exports all Exchange Server settings in single file per server. Then you can use for example windiff tool to compare files and see if you have deferent setting on different server. I will try to update my script later to automatically compare settings.  

 #CAS ARRAY
write-host “CAS Server Settings…”
write-output “=============== CONFIGURATION CAS Array ===============  “| out-file -FilePath MYORG_CasArray.txt
Get-clientAccessArray | fl >> MYORG_CasArray.txt

#CAS
foreach($Server.Name in Get-ClientAccessServer)
{
write-output “=============== CONFIGURATION CAS SERVER =============== ” | out-file -FilePath MYORG_CAS_$Server.txt
Get-ClientAccessServer -Identity $Server.Name | fl >> MYORG_CAS_$Server.txt
write-output “=============== CONFIGURATION OWA ===============” | out-file -FilePath MYORG_CAS_$Server.txt -Append

Get-OwaVirtualDirectory -Identity “$Server\owa (Default Web Site)” | fl >> MYORG_CAS_$Server.txt

write-output “=============== CONFIGURATION ECP ===============” | out-file -FilePath MYORG_CAS_$Server.txt -Append
Get-EcpVirtualDirectory -Identity “$Server\ecp (Default Web Site)” | fl >> MYORG_CAS_$Server.txt

write-output “=============== CONFIGURATION Active Sync ===============” | out-file -FilePath MYORG_CAS_$Server.txt -Append
Get-ActiveSyncVirtualDirectory -Identity “$Server\Microsoft-Server-ActiveSync (Default Web Site)” | fl >> MYORG_CAS_$Server.txt
write-output “=============== CONFIGURATION EWS ===============” | out-file -FilePath MYORG_CAS_$Server.txt -Append

Get-WebServicesVirtualDirectory -Identity “$Server\EWS (Default Web Site)” | fl >> MYORG_CAS_$Server.txt
}

#HUB
write-host “HUB Server Settings…”
foreach($Server.Name in Get-TransportServer)
{
write-output “=============== CONFIGURATION HUB SERVER =============== ” | out-file -FilePath MYORG_HUB_$Server.txt
Get-TransportServer -Identity $Server.Name | fl >> MYORG_HUB_$Server.txt
$s=$Server.Name +”*”
write-output “=============== CONFIGURATION RoutingGroupConnector =============== ” | out-file -FilePath MYORG_HUB_$Server.txt -Append

Get-RoutingGroupConnector | where-object {$_.name -like $s} | fl >> MYORG_HUB_$Server.txt
write-output “=============== CONFIGURATION ReceiveConnector =============== ” | out-file -FilePath MYORG_HUB_$Server.txt -Append
Get-ReceiveConnector –Identity “$Server\Default $Server” | fl >> MYORG_HUB_$Server.txt
}

#MBX
write-host “MBX Server Settings…”
foreach($Server.Name in Get-MailboxServer)
{
write-output “=============== CONFIGURATION MBX SERVER =============== ” | out-file -FilePath MYORG_MBX_$Server.txt
Get-MailboxServer $Server.Name | fl >> MYORG_MBX_$Server.txt
}

#DAG
write-host “DAG Settings…”
foreach ($Dag in Get-DatabaseAvailabilityGroup)
{
write-output “=============== CONFIGURATION DAG =============== ” | out-file -FilePath MYORG_DAG_$Dag.txt
Get-DatabaseAvailabilityGroup $Dag | fl >> MYORG_DAG_$Dag.txt
}

foreach ($DagN in Get-DatabaseAvailabilityGroupNetwork)
{
write-output “=============== CONFIGURATION DAG NETWORK =============== ” | out-file -FilePath MYORG_DAGNetwork.txt
Get-DatabaseAvailabilityGroupNetwork $DagN | fl >> MYORG_DAGNetwork.txt
}

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a comment