The quickest way to transfer FSMO roles to another server is so easy if you use PowerShell. Many people use GUI, but it takes so much time and is a pain in the ass for me.
This is a short article that is already shared on resources of Microsoft. In the test environment, I transferred all FSMO roles from one to another using both the role name and the parameter of values. As you know, there are 5 roles that we need to manage the organizations.
Briefly, the roles and parameter values are listed below. We will use both of them to transfer the roles between two domain controllers.
- PDCEmulator or 0
- RIDMaster or 1
- InfrastructureMaster or 2
- SchemaMaster or 3
- DomainNamingMaster or 4
The example PowerShell command is below and ready to be tested. The command can be run on any domain-joined computer as long as that computer has an Active Directory PowerShell module. In our case, the server name that we want to transfer is demodc02 and we use the value of each role.
Move-ADDirectoryServerOperationMasterRole -Identity demodc02 -OperationMasterRole 0,1,2,3,4

As you see in the picture we printed out our current server name, the active directory servers, and the server that holds FSMO roles. At the end, we transfer all roles to the second active directory server.
Let’s transfer all roles from demodc02 to demodc01 using the role names.
Move-ADDirectoryServerOperationMasterRole -Identity demodc01 -OperationMasterRole SchemaMaster,DomainNamingMaster,PDCEmulator,RIDMaster,InfrastructureMaster

As you see it is easy and all roles are transferred quickly to the new server. Thanks for your time reading my article. Have a good and successful day.
Reference article: https://learn.microsoft.com/en-us/powershell/module/activedirectory/move-addirectoryserveroperationmasterrole?view=windowsserver2022-ps
Hasan Altin