{"id":268,"date":"2013-09-15T06:03:28","date_gmt":"2013-09-15T06:03:28","guid":{"rendered":"http:\/\/www.itcrumbs.com\/?p=268"},"modified":"2019-02-07T04:40:11","modified_gmt":"2019-02-07T04:40:11","slug":"powershell-move-ad-fsmo-roles-in-server-2012","status":"publish","type":"post","link":"http:\/\/www.itcrumbs.com\/?p=268","title":{"rendered":"PowerShell &ndash; Move AD FSMO Roles in Server 2012"},"content":{"rendered":"<h3><a title=\"http:\/\/www.nogeekleftbehind.com\/2013\/05\/28\/powershell-move-ad-fsmo-roles-in-server-2012\/\" href=\"http:\/\/www.nogeekleftbehind.com\/2013\/05\/28\/powershell-move-ad-fsmo-roles-in-server-2012\/\">http:\/\/www.nogeekleftbehind.com\/2013\/05\/28\/powershell-move-ad-fsmo-roles-in-server-2012\/<\/a><\/h3>\n<h3><a href=\"http:\/\/www.nogeekleftbehind.com\/2013\/05\/28\/powershell-move-ad-fsmo-roles-in-server-2012\/\">PowerShell \u2013 Move AD FSMO Roles in Server 2012<\/a><\/h3>\n<p>Over the long weekend we worked on two projects:<\/p>\n<ol>\n<li>Upgrade the Hyper-V hosts on the cluster at the data center<\/li>\n<li>Finish prepping a new Hyper-V host and Domain Controller for a new branch office with a new subnet<\/li>\n<\/ol>\n<p><a href=\"http:\/\/www.nogeekleftbehind.com\/PowerShell---Move-AD-FSMO-Roles-in-Serve_AA57\/image.png\"><img loading=\"lazy\" decoding=\"async\" title=\"image\" border=\"0\" alt=\"image\" src=\"http:\/\/www.nogeekleftbehind.com\/PowerShell---Move-AD-FSMO-Roles-in-Serve_AA57\/image_thumb.png\" width=\"107\" align=\"right\" height=\"81\" \/><\/a>Since the cluster at the data center holds all of the Active Directory FSMO roles we needed to transfer the roles to an alternate location on the MPLS network so that project 1 didn\u2019t slow down or stop project 2.<\/p>\n<p>PowerShell to the rescue!<\/p>\n<p><strong>WHICH SERVER HOLDS THE FSMO ROLES?<\/strong><\/p>\n<p>Open PowerShell as an Administrator and type:<\/p>\n<blockquote>\n<p><strong>netdom query fsmo<\/strong><\/p>\n<\/blockquote>\n<p>You\u2019ll see each of the 5 FSMO roles and which domain controller holds them.<\/p>\n<p><a href=\"http:\/\/www.nogeekleftbehind.com\/PowerShell---Move-AD-FSMO-Roles-in-Serve_AA57\/image_3.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Using PowerShell to transfer FSMO roles\" border=\"0\" alt=\"Using PowerShell to transfer FSMO roles\" src=\"http:\/\/www.nogeekleftbehind.com\/PowerShell---Move-AD-FSMO-Roles-in-Serve_AA57\/image_thumb_3.png\" width=\"361\" height=\"92\" \/><\/a><\/p>\n<p>The 5 FSMO roles are numbered 0-4:<\/p>\n<p>0 \u2013 PDCEmulator    <br \/>1 \u2013 RIDMaster     <br \/>2 \u2013 InfrastructureMaster     <br \/>3 \u2013 SchemaMaster     <br \/>4 \u2013 DomainNamingMaster<\/p>\n<p>Why do we care what those numbers are? Because we can move the FSMO roles very quickly and save a lot of typing.<\/p>\n<p>For example, which PowerShell command is easier to type?<\/p>\n<blockquote>\n<p><strong>Move-ADDirectoryServerOperationMasterRole -Identity \u201cTarget-DC\u201d -OperationMasterRole SchemaMaster,RIDMaster,InfrastructureMaster,DomainNamingMaster,PDCEmulator<\/strong><\/p>\n<\/blockquote>\n<p>Or this one?<\/p>\n<blockquote>\n<p><strong>Move-ADDirectoryServerOperationMasterRole -Identity &quot;Target-DC&quot; -OperationMasterRole 0,1,2,3,4<\/strong><\/p>\n<\/blockquote>\n<p>Personally, if you\u2019re moving all the roles at once to the same DC (like when doing some server maintenance) the 0,1,2,3,4 is easy.<\/p>\n<p>Once you type in either of those commands you are prompted with several options for confirmation.<\/p>\n<p>Y, A, N, L, S or ?<\/p>\n<p><a href=\"http:\/\/www.nogeekleftbehind.com\/PowerShell---Move-AD-FSMO-Roles-in-Serve_AA57\/image_4.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Moving FSMO roles with PowerShell\" border=\"0\" alt=\"Moving FSMO roles with PowerShell\" src=\"http:\/\/www.nogeekleftbehind.com\/PowerShell---Move-AD-FSMO-Roles-in-Serve_AA57\/image_thumb_4.png\" width=\"454\" height=\"38\" \/><\/a><\/p>\n<p><strong>OPTIONS:<\/strong><\/p>\n<p>If you choose \u201cY\u201d for Yes, PowerShell will prompt you to move each role,    <br \/>then move to the next role, like this.<\/p>\n<p><a href=\"http:\/\/www.nogeekleftbehind.com\/PowerShell---Move-AD-FSMO-Roles-in-Serve_AA57\/image_5.png\"><img loading=\"lazy\" decoding=\"async\" title=\"PowerShell FSMO role transfer - individual confirmation\" border=\"0\" alt=\"PowerShell FSMO role transfer - individual confirmation\" src=\"http:\/\/www.nogeekleftbehind.com\/PowerShell---Move-AD-FSMO-Roles-in-Serve_AA57\/image_thumb_5.png\" width=\"454\" height=\"156\" \/><\/a><\/p>\n<p>If you choose \u201cN\u201d for No, PowerShell will skip transferring that role.<\/p>\n<p>If you choose \u201cA\u201d for All, PowerShell will try to transfer all 5 roles to Target-DC. <\/p>\n<p>If the transfer of a FSMO role <em>fails<\/em> PowerShell will let you know loud and clear.<\/p>\n<p><a href=\"http:\/\/www.nogeekleftbehind.com\/PowerShell---Move-AD-FSMO-Roles-in-Serve_AA57\/image_6.png\"><img loading=\"lazy\" decoding=\"async\" title=\"PowerShell FSMO role transfer message\" border=\"0\" alt=\"PowerShell FSMO role transfer message\" src=\"http:\/\/www.nogeekleftbehind.com\/PowerShell---Move-AD-FSMO-Roles-in-Serve_AA57\/image_thumb_6.png\" width=\"454\" height=\"58\" \/><\/a><\/p>\n<p><strong>CONFIRMATION:<\/strong><\/p>\n<p>Unfortunately, if the transfer is <em>successful<\/em> you basically don\u2019t get any confirmation of the role transfer. <\/p>\n<p>You\u2019ll need to run <strong>NETDOM QUERY FSMO<\/strong> to double-check who has the roles.     <br \/><a href=\"http:\/\/www.nogeekleftbehind.com\/PowerShell---Move-AD-FSMO-Roles-in-Serve_AA57\/image_7.png\"><img loading=\"lazy\" decoding=\"async\" title=\"NETDOM QUERY FSMO to double-check FSMO role location\" border=\"0\" alt=\"NETDOM QUERY FSMO to double-check FSMO role location\" src=\"http:\/\/www.nogeekleftbehind.com\/PowerShell---Move-AD-FSMO-Roles-in-Serve_AA57\/image_thumb_7.png\" width=\"365\" height=\"113\" \/><\/a><\/p>\n<p>Side note \u2013 Once nice thing about using PowerShell to transfer the FSMO roles is that you can script the transfer to run at a scheduled time (so you don\u2019t forget to put the roles back where they should be later).<\/p>\n<p>Also, I didn\u2019t have to load the Active Directory PowerShell module \u2013 Windows Server 2012 does that for me automatically.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/www.nogeekleftbehind.com\/2013\/05\/28\/powershell-move-ad-fsmo-roles-in-server-2012\/ PowerShell \u2013 Move AD FSMO Roles in Server 2012 Over the long weekend we worked on two projects: Upgrade the Hyper-V hosts on the cluster at the data center Finish prepping a new Hyper-V host and Domain Controller for a new branch office with a new subnet Since the cluster at the data center [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-268","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.itcrumbs.com\/index.php?rest_route=\/wp\/v2\/posts\/268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.itcrumbs.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.itcrumbs.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.itcrumbs.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"http:\/\/www.itcrumbs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=268"}],"version-history":[{"count":1,"href":"http:\/\/www.itcrumbs.com\/index.php?rest_route=\/wp\/v2\/posts\/268\/revisions"}],"predecessor-version":[{"id":696,"href":"http:\/\/www.itcrumbs.com\/index.php?rest_route=\/wp\/v2\/posts\/268\/revisions\/696"}],"wp:attachment":[{"href":"http:\/\/www.itcrumbs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.itcrumbs.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=268"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.itcrumbs.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}