![]() And to isolate the DC we want to clean up, we’ll need to filter the resulting data. The data we need to filter on is part of the “RecordData” data column which in and of itself is an array of data. What we get though isn’t the full picture. $dnsrecords = Get-DnsServerResourceRecord -ZoneName “_” If you’re looking for detailed explanations of all the DNS records this will delete, you’ll want to go find an article about Active Directory DNS! What I will do, is demonstrate an easy way to delete all DNS records related to a Domain Controller with a single PowerShell command.įirst, let’s create an array of all the records in the zone _: I was cleaning up records manually one day and as I typically do, I thought to myself, there has to be a better way… and there is.īefore I continue though, this is not an Active Directory Disaster Recovery article. Regardless of the scenario, cleaning DNS is a critical part of this and I’ve frequently found it to be the part that scares customers the most. Sometimes that’s as simple as the old DC that has to go away or as scary as having recovered AD from backup and having to remove all other DCs as we rebuild. So, as an Active Directory PFE, one of the common things we help customers out with is removing Domain Controllers from the environment. Whether it’s as part of Active Directory Disaster Recovery, or because you had an old Domain Controller you needed to get rid of, cleaning up all the DNS records of a now dead DC left behind can be tedious: that is, unless you use PowerShell My good friend Patrick Mercier, An Active Directory PFE who loves working with PowerShell. The good Doctor also knows the very person to answer it best. How can I quickly clean up all my dead Domain Controller’s DNS records? Summary: Using Windows PowerShell to remove Stale / Dead Domain Controller records. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |