Automating replication testing
Posted by: Richard Siddaway
Building on the recent post about testing replication I though a bit more automation was needed. Lets create a function to discover the domain controllers
function get-DomainControllerNames { $dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() $dom.FindAllDomainControllers() | select -ExpandProperty Name }
We then use a simple pipeline to produce a nicely formatted report
get-DomainControllerNames |
foreach { test-replication -computername $_ } |
Format-Table -Property SourceDsACN, NamingContextDN, Last* -GroupBy DomainController –AutoSize
DomainController: DC02.Manticore.org
SourceDsaCN NamingContextDN LastSyncAttempt LastSyncSuccess
———– ————— ————— —————
SERVER02 DC=Manticore,DC=org 06/02/2012 10:53:45 06/02/2012 10:53:45
SERVER02 CN=Configuration,DC=Manticore,DC=org 06/02/2012 10:01:46 06/02/2012 10:01:46
SERVER02 CN=Schema,CN=Configuration,DC=Manticore,DC=org 06/02/2012 10:01:46 06/02/2012 10:01:46
SERVER02 DC=DomainDnsZones,DC=Manticore,DC=org 06/02/2012 10:22:17 06/02/2012 10:22:17
SERVER02 DC=ForestDnsZones,DC=Manticore,DC=org 06/02/2012 10:07:02 06/02/2012 10:07:02
DomainController: SERVER02.Manticore.org
SourceDsaCN NamingContextDN LastSyncAttempt LastSyncSuccess
———– ————— ————— —————
DC02 DC=Manticore,DC=org 06/02/2012 10:03:17 06/02/2012 10:03:17
DC02 CN=Configuration,DC=Manticore,DC=org 06/02/2012 10:02:01 06/02/2012 10:02:01
DC02 CN=Schema,CN=Configuration,DC=Manticore,DC=org 06/02/2012 09:59:38 05/02/2012 19:48:03
DC02 DC=ForestDnsZones,DC=Manticore,DC=org 06/02/2012 10:07:17 06/02/2012 10:07:17
DC02 DC=DomainDnsZones,DC=Manticore,DC=org 06/02/2012 10:22:00 06/02/2012 10:22:00
If you have a very large number of domain controllers this may take a while to run. In that case split the domain controller list into a number of CSV files and work from those.



You must be logged-in to post a comment. Log-in/Register