Hero Image
Removing a Failed or Dead Domain Controller from Active Directory (GUI & CLI Methods)

When a Domain Controller (DC) is powered off permanently, lost, or improperly demoted, Active Directory can keep stale references to it. These leftovers cause replication errors, DNS inconsistencies, and problems with FSMO transfers or new DC promotions. This guide covers both the GUI and command-line ways to clean it up. Which Method to Use DC is still reachable → use Method 1: Server Manager below. This is Microsoft’s recommended graceful demotion path. DC is dead / unreachable, GUI available → use Method 2: ADUC below. DC is dead / unreachable, scripted or remote (no GUI) → use Method 3: PowerShell below. On Windows Server 2008 and later, Methods 2 and 3 both trigger metadata cleanup automatically — deleting the DC’s NTDS Settings object is what actually does it, whether that happens via ADUC’s wizard or a PowerShell cmdlet. The manual ntdsutil steps (Method 4) are only needed as a fallback — e.g., the object is already gone but stale references remain, or the automatic cleanup fails. DC is an RODC → see the note after Method 2; the removal flow and considerations differ. Warning: Only remove a DC’s metadata if it’s confirmed permanently gone. Running the manual cleanup steps against a DC that’s still alive (temporarily unreachable, network partition, etc.) will corrupt replication. Confirm FSMO roles have been transferred/seized and that you have a recent AD backup before proceeding with any of these methods.

Hero Image
One-Line Server Inventory & AD Audit Report

Purpose Every Windows environment I inherit has the same problem — nobody knows what’s actually on the servers. Who’s got a password older than a year? Which computers haven’t checked in for six months? Is BitLocker actually on? This one-liner bootstraps VB.ServerInventory and produces a full server + AD audit report in a single run. No agent, no console, no license. What This Covers What the bootstrap script actually does (line by line) The report it produces and what’s in it Which security baselines the audit checks map to How to run it and verify the output Before You Start Windows Server 2016+ or Windows 10/11 with PowerShell 5.1 or later Local admin on the target machine Domain admin (or delegated read) if you want the AD, GPO, and DHCP sections populated Internet access to reach PSGallery and the gist ExecutionPolicy needs to allow the run — the script sets Unrestricted for CurrentUser scope The Bootstrap Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force # Enforce TLS 1.2 — PSGallery rejects older protocols [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 # Register PSGallery if it's missing (fresh servers often have no repos) if (-not (Get-PSRepository -Name "PSGallery" -ErrorAction SilentlyContinue)) { Register-PSRepository -Default -ErrorAction Stop } # Trust PSGallery so Install-Module doesn't prompt Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted # Widen the console buffer so nothing scrolls off screen $host.UI.RawUI.BufferSize = New-Object System.Management.Automation.Host.Size(500, 9000) Get-PSRepository # Pull and execute the inventory script from the gist [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 iex (Invoke-WebRequest "https://gist.githubusercontent.com/Vibhu2/9a4ecf03d30c35d27073c71a2d5f0d4d/raw/b0541f3663701a2b16d0e1a8fd4a4030f9bf70ee/gistfile1.txt" -UseBasicParsing).Content The first block is prep — TLS, repo trust, buffer size. The last line is the actual work: it pulls the Get-ServerInventory script from a gist and runs it in the current session.