Move all FSMO roles to the local domain controller using Powershell

I upgraded one domain controller in my home active directory and needed to move all the FSMO the new domain controller. So since I’m really lazy and like quick solutions I check what powershell could help me with. And since I know it should live in the ActiveDirectory module I decided to list all move commands in that module.

So now when we found the Move-ADDirectoryServerOperationMasterRole we need to decide where we want the roles moved, I want them on my local machine, and given the findings in my earlier blog post about getting the computer name I choose [system.environment]::Machinename. So now we know how to name our own computer, so we could just move the roles we are interested in. And since I know what I’am doing I don’t to answer that I’m sure all the time, so I added the -Confirm:$False. The commands for the domain and forest unique roles is:

Domain unique roles:

 Forest unique roles:

or.. Since that gave us 5 lines we really need to be able to do this faster. I want it Faster…

Move all roles:

Or if that is to long we could short it down by replacing the roles names with their numerical counterparts, but I feel that kills some the readability of the oneliners.

Leave a Reply