Skip to content
LogoTechnipages
LogoTechnipages
  • Topics
        • Android
        • Browsers
        • Gaming
        • Hardware
        • Internet
        • iPhone
        • Linux
        • macOS
        • Office
        • Reviews
        • Software
        • Windows
        • Definitions
        • All Recent Posts
  • Product Reviews
  • About

PowerShell: Get Old AD DNS Records

Mitch BartlettJanuary 23, 2020 Comments (0)
Active Directory logo

Sometimes Active Directory DNS fails to scavenge properly and delete old DNS records. You can grab a list of records using PowerShell.

Use this example to grab DNS records from the year 2017. Replace “DCName” with the name of a Domain Controller and “ad.yourdomain.com” with your domain name:

Get-DnsServerResourceRecord -ComputerName DCName -ZoneName "ad.yourdomain.com" -RRType "A" | Where {$_.TimeStamp.Year -eq 2017}

This code will show DNS records older than 14 days:

Get-DnsServerResourceRecord -ComputerName DCName -ZoneName "ad.yourdomain.com" -RRType "A" | Where {($_.Timestamp -le (get-date).adddays(-14)) -AND ($_.Timestamp -like "*/*")}

Categories: Windows

Author Mitch Bartlett

Through my career that spans over 20 years I have become an expert in Microsoft Systems Administration, Android, and macOS. I started this site as a technical guide for myself and it has grown into what I hope is a useful knowledgebase for everyone.

You Might Also Like

  • How to Pin Any Window to Always Be on Top in Windows

    Mel HawthorneWindows
  • Windows 10: How to Hide Recently Added Programs from Start Menu

    Judy SanhzWindows
  • Windows 10 Command Prompt Appears Then Disappears

    Madalina DinitaWindows
  • Windows 10 – How to Uninstall a Program Using the Command Prompt

    Judy SanhzWindows

Leave a Reply

Your email address will not be published. Required fields are marked *

  • npu power management bug

    What Is the NPU Power Management Bug and How Do You Fix It?

  • pc can't enroll for windows 10 extended security updates

    PC Can’t Enroll for Windows 10 Extended Security Updates – How to Fix

  • hdd better than an ssd

    When Is an HDD Better Than an SSD?

  • top graphics cards for 2026

    Top 5 Graphics Cards for 2026

  • roblox error 280

    Having Trouble With Roblox Error 280? Here’s What to Do

profile pic

The Experts Behind Technipages

My name is Mitch Bartlett. I've been working in technology for over 20 years in a wide range of tech jobs from Tech Support to Software Testing. I started this site as a technical guide for myself and it has grown into what I hope is a useful reference for all.

Learn More

technipages logo white
linkedin icon

Technipages is part of Guiding Tech Media, a leading digital media publisher focused on helping people figure out technology. Learn more about our mission and team here.

© 2026 Guiding Tech Media All Rights Reserved

  • About Us
  • Contact
  • Terms of Use
  • Privacy Policy

© 2026 Guiding Tech Media All Rights Reserved

Information from your device can be used to personalize your ad experience.
Do not sell my personal information.

Last Updated on January 23, 2020 by Mitch Bartlett