Blue Flower

$domain = "<domain name>"
$server = "<server name>"
Import-Module ActiveDirectory
Get-ADForest $domain| ft DomainNamingMaster, SchemaMaster
Get-ADDomain $domain | ft InfrastructureMaster, PDCEmulator, RIDMaster
Move-ADDirectoryServerOperationMasterRole -Identity $server –OperationMasterRole DomainNamingMaster,PDCEmulator,RIDMaster,SchemaMaster,InfrastructureMaster
Get-ADForest $domain| ft DomainNamingMaster, SchemaMaster
Get-ADDomain $domain | ft InfrastructureMaster, PDCEmulator, RIDMaster