Checking if a Service account has Replicate Directory Changes

If you have ever had to set up the User Profile Synchronization Service Connection to Active Directory, then you know that there needs to be a service account that either has Replicate Directory Changes Permission on the domain or on the various containers and OU’s.  I really can’t think of why you would not just allow the svc account the replicate directory permission on the entire domain, but you can get granular if you wanted too.  Besides, you can specify the OU’s and containers to sync when creating the sync connection.

 

Here is the code you can run to check if the svc account has Replicate Directory Changes

Save that into a PS1 and then call it like this from an administrative PowerShell Session

 

.\CheckRDC.ps1 “domain\UserName”

e.g.

.\CheckRDC.ps1 “contoso\SP_UPS”