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 *

  • link to a master sheet in excel

    How to Link to a Master Sheet in Excel

  • sound in xbox party chat on pc

    How to Change Sound Input and Output Devices in Xbox Party Chat on PC

  • bluetooth toggle missing windows 11

    What to Do When Your Bluetooth Toggle Is Missing (Windows 11)

  • microsoft paint features

    Unleash Your Inner Artist – Advanced Microsoft Paint Features You Might Not Know About

  • how to make chromebook run faster

    8 Ways to Make Your Chromebook Run Faster

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