Fix Access Denied Error When Demoting an Active Directory Domain Controller
Question details
The user needs to demote a secondary Active Directory domain controller but encounters an Access Denied error from DFS Replication, preventing normal uninstallation.

- Product
- Windows Server
- Device & OS
- not provided
- Scenario
- Attempting to uninstall Active Directory Domain Services and demote a domain controller when DFS replication has failed or been removed.
- Observed behavior
- The standard domain controller demotion process fails and consistently returns an Access Denied error.
Verify that your primary domain controller and DNS services are healthy and functioning correctly before manually removing any Active Directory components.
Clean Up AD DS Metadata and Manually Remove the Domain Controller
When normal demotion fails due to damaged replication, you must bypass the standard process, forcefully remove the failed domain controller, and manually clean up its metadata from Active Directory.
If the domain controller cannot communicate with the domain or DFS replication is broken, the standard demotion wizard will not work. You must perform a manual metadata cleanup to ensure no orphaned objects remain in your Active Directory environment.
Log into a healthy domain controller. Use the Active Directory Sites and Services console or the NTDSUTIL command-line tool to delete the metadata associated with the failed secondary domain controller.
Open Active Directory Users and Computers, navigate to the Domain Controllers Organizational Unit (OU), and manually delete the computer object for the failed server.
Open the DNS Manager and manually delete any remaining DNS records (such as A records, CNAME, or SRV records) that point to the demoted domain controller to prevent client connection issues.
On the failed secondary server, forcefully remove the Active Directory Domain Services role using Server Manager or PowerShell if the role still appears installed.
Manage Your IT Documentation Effectively with WPS Office
While troubleshooting server infrastructure and Active Directory errors, maintaining clear and accurate IT documentation is essential. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office, perfect for drafting server topology reports, standard operating procedures, and administrative guides.
- 1. Download the installer: Visit the official WPS Office website and download the free installer for your administrative workstation.
- 2. Install WPS Office: Run the lightweight setup to install Writer, Spreadsheet, and Presentation modules in seconds.
- 3. Open existing IT documents: Seamlessly open your existing Microsoft Office documentation and continue editing without format loss.

Frequently Asked Questions
Why do I get an Access Denied error from DFS Replication when demoting a DC?
This error typically occurs when the domain controller has lost communication with the primary controller, or if the DFS Replication database is corrupt or out of sync, preventing the demotion process from properly verifying the replication state.
What happens if I forcefully remove a domain controller without cleaning metadata?
Failing to clean up the metadata leaves orphaned server records in Active Directory and DNS. This can cause persistent replication errors, delays in client authentication, and conflicts when promoting new domain controllers in the future.
Can I use NTDSUTIL to remove the failed domain controller?
Yes, NTDSUTIL is the standard, Microsoft-recommended command-line tool used to safely clean up Active Directory metadata and manually remove lingering references to a failed domain controller.




