Transfer all of the FSMO roles in one powershell-shot / command

I just came out and find out a nice command that will transfer all the roles from one-shot from one DC to another.

 

To do so, we will need to accomplish the following :

  • 2 DC’s (one of which, holding all the 5 fsmo roles )

In order to start, we will connect to the FSMO holder

use the following command in order to ensure the role holder

Netdom /query fsmo

Run the following command to transfer all the roles to the target server where target_dc_name is the future FSMO role holder.

Move-ADDirectoryServerOperationMasterRole -Identity “Target_DC_Name” –OperationMasterRole 0,1,2,3,4 -force

The following list details the role number for each of the five FSMO roles.

PDC Emulator – 0

RID Master  1

Infrastructure Master  2

Schema Master   3

Domain Naming Master – 4

 

As displayed, the console will ask if you want to move it all, I have answer “A” , meaning yes to all.  My server is called ICSIN2.

2018-01-23 11_51_21-W2016DC1 on 2016CORE - Virtual Machine Connection.png

As you can see after running the command I have run the query on ICSIN2 and it displays as the FSMO role holder.

 

2018-01-23 11_53_28-RRAS on 2016CORE - Virtual Machine Connection.png

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.