While working in my lab I found that my replication between sites was not working as fast as I needed. So I created a script to trigger the repadmin command every 5 minutes.
Create Auto-Replication.ps1 file
- Open Notepad or your favorite powershell editor
- Type this line: 1..2094|foreach {start-sleep -s 5;cmd /c repadmin /syncall /AeP}
- Save file as Auto-Replication.ps1
Change PowerShell Execution
- Open PowerShell Administrator Window
- Change execution to remotesigned: Set-ExecutionPolicy RemoteSigne
Execute the Script
- Now you can call your Auto-Replication.ps1 . It will run for a week before it stops.