Hem > IT, Microsoft, PowerShell > Get a list of DC replication partners using repadmin and PowerShell

Get a list of DC replication partners using repadmin and PowerShell

If you work in a large enterprise organization with multiple sites and an Active Directory with at least one DC per site, it can be a bit of a pain to get a good overview of how replication is working. This PowerShell-snippet which uses repadmin provides an easy to read view of all DCs and their replication partners:

$dcList = 'List','of','your','favorite','DCs'
$hubba  = @()
foreach($dc in $dcList) {
   $bubba  = Invoke-Expression "repadmin /showrepl /csv $dc" | ConvertFrom-Csv
   $hubba += $bubba | Select-Object Destination` DSA,Source` DSA| Sort-Object -Unique Source` DSA
}
$hubba

Note: You can get a lot more useful information with the repadmin tool if you toy around a bit with the parameters.

Categories: IT, Microsoft, PowerShell Taggar:
  1. Inga kommentarer än.