TIL Move-ADDirectoryServerOperationMasterRole uses legacy name rather than FQDN or hostname

I always have to google this command but I also love how concise it is for moving all FSMO in one command. I’ve run into this problem twice now and I finally noticed the problem when working on a DC that I didn’t originally spin up.

I kept getting this response:

Move-ADDirectoryServerOperationMasterRole : Cannot find directory server with identity:
‘DomainController2’.

The first time through I found a solution here: http://therealshrimp.blogspot.com/2017/02/move-addirectoryserveroperationmasterro.html but I didn’t really know what I’d changed that made it work. In hindsight I think I was assuming FQDN would be the best way to positively identify the correct server to transfer roles to. Switching to hostname only worked in the first case, the second time though, I had already tried both.

It dawned on me, the problem was that this server was beyond the 15 character limit for it’s name, so the legacy or pre-windows 2000 name was truncated. I needed to use the pre-windows 2000 name rather than the full hostname.

Move-ADDirectoryServerOperationMasterRole "DOMAINCONTROLLE" -OperationMasterRole 0,1,2,3,4

Worked perfectly. The -? output doesn’t really say anything about this requirement but the detailed online help does mention this as well as using guids and other methods to identify the server: https://learn.microsoft.com/en-us/powershell/module/activedirectory/move-addirectoryserveroperationmasterrole?view=windowsserver2022-ps

Leave a comment

Design a site like this with WordPress.com
Get started