So I have assigned the AD SAM template to my AD servers and every month I switch on my AD DC DR servers to patch. I then get an alert to tell me that the AD synchronisation isn't working.
I'd like to create a new component to replace this current component, which has the ability to run via a powershell script. The script should be capable of checking that the sync is successful, if it finds any server unsuccessful, it shall try to force the sync via the PowerShell script initially. If this doesn't work, then show the replication status as failed.
has anybody else done something similar to this?
The closest I've got with the PowerShell is;
or this simple function;
function Replicate-AllDomainController {(Get-ADDomainController -Filter *).Name | Foreach-Object {repadmin /syncall $_ (Get-ADDomain).DistinguishedName /e /A | Out-Null}; Start-Sleep 10; Get-ADReplicationPartnerMetadata -Target "$env:userdnsdomain" -Scope Domain | Select-Object Server, LastReplicationSuccess}