virtualcenter


Our IT journal

Clean up records on Windows Server DNS using PowerShell

Create a script and execute it on your server. Set up a zone, the Windows Server running the DNS server, a date and the record type. Import-mode DNSServer $zone=”ZONE.TLD” $DNSServer=”DNSHOSTNAME” $beforedate=”12/20/2015″ $recordtype=”A” $records=Get-DnsServerResourceRecord -ZoneName “$zone” -ComputerName $DNSServer | Where-Object {$_.RecordType -eq “$recordtype” -and $_.TimeStamp -lt $beforedate} Foreach ($record in $records) { # Remove the DNS record by filtering Try { … Read More