Skip to content
Tech Master Tech Master

OneStopTechnical Forum

  • Books
  • AI
  • Networking
  • Windows
  • Linux
  • Cloud
  • Mac
  • Active Directory
  • Azure
  • Cloud
  • Exchange
  • M365
  • Server 2025
  • Storage
  • Vsphere
  • Website
  • Database
  • Security
  • Knowledge Base
  • VPN
Tech Master
Tech Master

OneStopTechnical Forum

Metadata cleanup in Active Directory

blog.payperitem.com, April 15, 2025April 15, 2025

Performing metadata cleanup in Active Directory is necessary when a domain controller (DC) has been forcefully removed or decommissioned incorrectly, leaving stale references in AD. This can cause replication issues and other problems.

Here’s a step-by-step guide for performing metadata cleanup in Windows Server (applies to Server 2012 and later, including 2019/2022):


✅ 1. Use Active Directory Users and Computers to Remove the DC (if still visible)

Before using command-line tools, try this:

  1. Open Active Directory Users and Computers (dsa.msc).
  2. Navigate to Domain Controllers OU.
  3. If the stale DC is listed, right-click > Delete.
  4. Confirm the deletion and choose “This domain controller is permanently offline” if prompted.

✅ 2. Use ntdsutil for Full Metadata Cleanup

a. Launch ntdsutil:

ntdsutil

b. Enter metadata cleanup:

ntdsutil

metadata cleanup

c. Connect to the correct server:

ntdsutil:

connect to server <YourLiveDCName>

d. Select the domain:

ntdsutil:
select operation target
list domains
select domain <number>

e. Select the site:

ntdsutil:
list sites
select site <number>

f. Select the failed server:

ntdsutil:
list servers in site
select server <number>

g. Remove the selected server:

ntdsutil:quit
remove selected server

h. Quit:

ntdsutil quit
quit

✅ 3. Clean up DNS

Manually remove:

  • A and CNAME records of the old DC.
  • SRV records under zones like:
    • _msdcs.domain.com
    • _sites
    • _tcp
    • _udp

Use DNS Manager (dnsmgmt.msc) to find and delete any leftover records.


✅ 4. Clean up Sites and Services

Open Active Directory Sites and Services (dssite.msc):

  • Expand the site the server belonged to.
  • Expand Servers.
  • If the old server still exists, delete it.
  • Also remove associated NTDS Settings if still present.

✅ 5. Optional – Use PowerShell for Detection

To find orphaned DC metadata:

Get-ADDomainController -Filter * | Select-Object Name,IsGlobalCatalog,IPv4Address,Site


🚨 Things to Watch Out For

  • Never do metadata cleanup on a live/healthy DC.
  • Always verify replication is healthy after: cmdCopyEditrepadmin /replsummary repadmin /showrepl *
  • Backup AD before performing metadata cleanup.

Active Directory Security Server 2025 Windows

Post navigation

Previous post
Next post

Related Posts

How to Configure Distributed File System (DFS) in Windows Server

March 30, 2025

DFS (Distributed File System) in Windows Server allows for the organization of shared folders across multiple servers into a single namespace, improving accessibility and redundancy. DFS consists of two key components: Prerequisites Step 1: Install DFS Roles Step 2: Configure a DFS Namespace Step 3: Add DFS Folders and Targets…

Read More

Difference between Share vs NTFS Permissions vs Security

April 14, 2025April 14, 2025

📊 Comparison Table: Share vs NTFS Permissions vs Security Feature / Aspect Share Permissions NTFS Permissions Security Settings (ACLs) 📍 Where Configured Sharing tab → Advanced Sharing Security tab Security tab → Advanced 🔗 Applies To Access over the network (SMB/UNC paths) Access over local + network Full NTFS model…

Read More

User Unable to Log In to Domain

April 3, 2025

Situation: A user reports they are unable to log in to their workstation, receiving an error that states, “The user name or password is incorrect.” Step 1: Verify User Credentials Step 2: Check Username and Domain Name Step 3: Account Status Step 4: Network Connectivity Step 5: DNS Configuration Step…

Read More

Recent Posts

  • List of AD Schema Versions
  • OldNewExplorer Free Download For Windows 11, 10, 8 and 7 [Latest Version]
  • How to Get the Classic (old) Context Menu on Windows 11
  • BitLocker Recovery Keys
  • Active Directory and Server hardening

Recent Comments

No comments to show.
June 2025
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« May    
Log in
©2025 Tech Master | WordPress Theme by SuperbThemes
  • Login
  • Sign Up
Forgot Password?
Lost your password? Please enter your username or email address. You will receive a link to create a new password via email.
body::-webkit-scrollbar { width: 7px; } body::-webkit-scrollbar-track { border-radius: 10px; background: #f0f0f0; } body::-webkit-scrollbar-thumb { border-radius: 50px; background: #dfdbdb }