{"id":2187,"date":"2017-05-31T20:57:55","date_gmt":"2017-05-31T20:57:55","guid":{"rendered":"http:\/\/microsoftgeek.com\/?p=2187"},"modified":"2018-09-06T23:18:17","modified_gmt":"2018-09-06T23:18:17","slug":"replication-for-a-windows-domain-controller-2003-2008-2012","status":"publish","type":"post","link":"https:\/\/microsoftgeek.com\/?p=2187","title":{"rendered":"Replication for a Windows Domain Controller (2003, 2008, 2012)"},"content":{"rendered":"<p>If you would like to avoid using the AD Sites and Services GUI to force replication across your domain controllers, consider the script below. Save this as a .bat file to a machine on the same domain as your domain controllers and run as a domain administrator.<\/p>\n<p>The script will prompt you for the desired action, push or pull (default is pull), and then it will prompt you for the domain controller you wish to pull to or push from. You can use the simple hostname or FQDN.<\/p>\n<p>After finishing, the script will pause allowing you to review the results. You can also run repadmin \/showrepl on your target domain controller(s) to confirm successful replication. Let me know if you have any questions or suggestions:<\/p>\n<h2>The Script<\/h2>\n<pre>@echo off\r\n\r\nGOTO push_or_pull\r\n\r\n:push_or_pull\r\nset \/p action=\"Push or Pull or Quit [pull]: \" || set action=pull\r\n\r\nIF \/i %action% == pull GOTO pull_process\r\nIF \/i %action% == push GOTO push_process\r\nIF \/I %action% == quit GOTO end\r\nIF \/I %action% == q GOTO end\r\nIF \/i NOT %action% == pull GOTO invalid_input\r\n\r\n:invalid_input\r\necho \"Try again.\"\r\nGOTO push_or_pull\r\n\r\n:pull_process\r\nREM Pulls replication from other DCs across all sites to entered DC\r\nset \/p dc=\"Enter DC to pull replication to: \"\r\nrepadmin \/syncall %dc% dc=worthave,dc=local \/d \/e \/a \/A\r\nGOTO end\r\n\r\n:push_process\r\nREM Pushes replication all DCs across all sites from entered DC\r\nset \/p dc=\"Enter DC to push replication from: \"\r\nrepadmin \/syncall %dc% dc=worthave,dc=local \/d \/e \/a \/A \/P\r\nGOTO end\r\n\r\n:end\r\npause<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you would like to avoid using the AD Sites and Services GUI to force replication across your domain controllers, consider the script below. Save this as a .bat file to a machine on the same domain as your domain controllers and run as a domain administrator. The script will prompt you for the desired [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6,48],"tags":[],"class_list":["post-2187","post","type-post","status-publish","format-standard","hentry","category-general-2003-stuff","category-general-2008","category-microsoft-windows-server-2012"],"_links":{"self":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2187"}],"version-history":[{"count":1,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2187\/revisions"}],"predecessor-version":[{"id":2188,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=\/wp\/v2\/posts\/2187\/revisions\/2188"}],"wp:attachment":[{"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/microsoftgeek.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}