Decommissioning a Windows Server correctly matters more than most people realise. A server turned off without proper preparation can leave orphaned records in DNS and Active Directory, strand licences, disrupt dependent services, and leave sensitive data on disks that end up in a skip. Here is the right way to do it.
Before You Touch Anything
- Identify all services running on the server. Check IIS sites, scheduled tasks, shared folders, installed roles, and what applications are hosted. Other systems may depend on services you are not aware of.
- Check what connects to it. Review DNS records, firewall rules, and application configs that reference the server by name or IP. A server hosting an internal DNS entry used by 50 other systems will cause problems if simply turned off.
- Confirm the data has been migrated or archived. All data on the server that needs to be retained should have been moved to its new location before you start. Double-check with stakeholders.
- Check for FSMO roles. If this is a domain controller, run
netdom query fsmoto check if it holds any FSMO roles. Transfer them before decommissioning.
Step 1: Transfer or Migrate Services
Before decommissioning, ensure everything hosted on the server has been moved:
- Websites (IIS): migrated to the new server and tested
- Shared folders: data copied, DFS namespaces updated or redirected
- DNS records: A records pointing to this server updated to point to the replacement
- Scheduled tasks: replicated on the new server and tested
- Application database connections: connection strings in dependent applications updated
- Email (if an Exchange server): mailboxes migrated, connectors moved
Step 2: Remove from Active Directory (Domain Controllers)
If the server is a domain controller, demote it first — do not just turn it off:
# Demote a DC via PowerShell (run on the DC being demoted)
Uninstall-ADDSDomainController -LocalAdministratorPassword (Read-Host -Prompt "New local admin password" -AsSecureString) -Force
Or via Server Manager: Remove Roles and Features → Active Directory Domain Services → follow the wizard to demote. The server must be demoted, not just turned off — an abrupt shutdown of a DC leaves lingering metadata that needs manual cleanup.
If the DC is already dead and cannot be demoted cleanly:
# Force-remove a dead DC's metadata from AD
ntdsutil "metadata cleanup" "remove selected server [DC_NAME]" quit quit
Step 3: Remove Computer Account from Active Directory
For member servers (not DCs), after migration is complete:
- Open Active Directory Users and Computers
- Find the computer account
- Right-click → Disable Account first — leave it disabled for 2–4 weeks to confirm nothing breaks
- After the holding period, right-click → Delete
# PowerShell — disable then delete
Disable-ADComputer -Identity "OLDSERVER"
# ... wait and monitor ...
Remove-ADComputer -Identity "OLDSERVER"
Step 4: Clean Up DNS
# Remove A record for the decommissioned server
Remove-DnsServerResourceRecord -ZoneName "contoso.local" -Name "OLDSERVER" -RRType A -Force
# Remove PTR record (reverse lookup)
Remove-DnsServerResourceRecord -ZoneName "1.168.192.in-addr.arpa" -Name "10" -RRType PTR -Force
Also check for any CNAME records pointing to the old server name and remove or redirect them.
Step 5: Remove from Monitoring and Backup
- Remove the server from your monitoring system (PRTG, Nagios, Zabbix) — failed ping alerts for a server you turned off are noise that hides real alerts
- Remove the server from backup jobs — the backup software will otherwise continue to report failures
- Remove from any SNMP or NMS management platforms
Step 6: Revoke Licences and Update Records
- Windows Server licence: notify your licence portal or volume licensing agreement of the change
- Antivirus seat: remove the server from the AV management console to free the licence
- Any per-server software licences: SQL Server, monitoring agents, backup agents — reclaim or reassign
- Update your server documentation: mark the server as decommissioned with the date
Step 7: Wipe the Disks Before Hardware Disposal
This is non-negotiable for any server that held business data. Simply deleting files or reformatting is not sufficient:
- For spinning hard drives: use DBAN (Darik’s Boot and Nuke) or the manufacturer’s secure erase tool to overwrite all data multiple times
- For SSDs: use the manufacturer’s Secure Erase command (available via tools like Samsung Magician, Intel SSD Toolbox) — overwriting does not reliably erase SSDs due to wear levelling
- For drives with sensitive data: physical destruction (shredding) is the only guarantee
- BitLocker-encrypted drives: if the drive was fully encrypted with BitLocker before decommissioning, deleting the encryption key renders the data unrecoverable — secure but should be combined with a wipe for belt-and-braces compliance