All 5 FSMO roles of Active Directory can be moved via script, but lets see how it works via GUI (MMC):
RID Master, Infrastructure Master, and PDC Emulator
- Login to the target DC via RDP
- Open "AD Users and Computers"
- Right-click the Domain and choose "Operations Masters..."
- Choose the appropriate tab
- Click "Change..."
- Click "Yes" to confirm
Schema Master
Make sure you are member of the "Schema Admins" group. Being in the "Enterprise Admins" group is not enough!
- Login to the source DC via RDP
- Open "AD Schema"
- Right-click "Active Directory Schema" and choose "Change Active Directory Domain Controller"
- Choose the target DC
- Right-click "Active Directory Schema" and choose "Operations Masters..."
- Click "Change..."
- Click "Yes" to confirm
Domain Naming Master
- Login to target DC via RDP
- Open "AD Domains and Trusts"
- Right-click "Active Directory Domains and Trusts" and choose "Change Active Directory Domain Controller"
- Choose the target DC (might already be chosen)
- Right-click "Active Directory Domains and Trusts" and choose "Operations Masters..."
- Click "Change..."
- Click "Yes" to confirm