Remove Windows 200x Domain Controller from AD in DSRMode

While in DS restore mode open up regedit and navigate to khey_local_machine/system/currentcontrolset/control/productoptions. Change
the product type from lanmannt to servernt. Reboot into windows normally. The machine now thinks it’s a member server. Disjoin from the domain, reboot, and do a DC Promo up to a dummy domain. Make sure it’s pointed to itself for DNS resolution, it will aks you to install DNS during the promotion so say yes, and promote into a dummy domain called deleteme.com. Take all the defaults for the file locations. Once up, demote gracefully and you will remove all the things that made it a DC (sysvol, ntds.dit, etc). You are now back in a workkgroup. Join your original domain and run DCPromo after pointing the machine back to the original DNS server.

(Source: http://forums.techarena.in/archive/index.php/t-87024.html)