Server - Commands to verify Domain Controller/Domain Status, schema version, move 5 PDC roles, export DHCP

I am indicating some commands that put output on .txt file that are useful to verify domain health/check/monitor status:

dcdiag /TEST:DNS /v >> c:\temp\step1_dns.txt

netsh dhcp show server >> c:\temp\step2_dhcp.txt

dcdiag /a /v /c >> c:\temp\step3_dc.txt

repadmin /showrepl >> c:\temp\step4_replica.txt

repadmin /replsummary >> c:\temp\step5_replica_sum.txt

repadmin /replsum /errorsonly >> c:\temp\step6_replica_err.txt

repadmin /options * >> c:\temp\step7_replica_opt.txt 

If you want to verify Schema Version on DC you must to on register:


REG_WORD Schema Version and you will find relative number

If you like to upgrade schema before installing new Windows 2012 R2 domain controller you can utilize this article:


If you want to move 5 AD roles to a different DC you can do that through GUI in different locations

Schema master
Naming master
RID master
Infrastructure master

To query which DC holds precedents roles you can utilize this command:

netdom query fsmo

Otherwise we can take a look to following article:


If you want to migrate DHCP settings you can utilize this command:

Export-DhcpServer –ComputerName dcname.domain.xxxx -Leases -File C:\temp\dhcpconfig.xml -verbose

To import DHCP settings to other Server:

Import-DhcpServer -ComputerName w12r2-dc01.nolabnoparty.local -Leases -File C:\temp\dhcpconfig.xml -BackupPath C:\temp\dhcp_backup\ -verbose Type Y to proceed with import.

Later you will need to authorize DHCP on new DC

[original article]

[update 2022.03.15]

Active Directory Health Check: Troubleshooting