if you are installing a new domain controller in a branch office with TMG in the middle, remember to right click on the firewall rule that permit the traffic between the two office and select Configure RPC. Remove the check on the Enforce strict RPC compliance, Save and Apply the rule! After that, you can promote your new domain controller.
1- Demote the DC using the dcpromo /forceremoval.
2- Remove the server from the PDC using Active Directory Users and Computers, flagging the “this domain controller is pemanently offline and can no longer be demoted using the active directory domain services installation wizard (DCPROMO)” checkbox. It is not necessary to clean with ntdsutil the metadata. These operations are included with the deletion of the domain controller from the GUI.
3- Remove the AD role.
4- Reinstall the AD role.
5- Promote the DC using dcpromo