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 *

  • clipchamp unexpected application error

    Clipchamp Unexpected Application Error: Here’s the Solution 

  • winload.efi file missing error

    Winload.EFI File Missing Error on Boot – How to Fix

  • fix error 0x9cfc7550

    How to Fix Error 0x9cfc7550 (We Couldn’t Create a New Partition) in Windows 

  • fix error code 0x3000008 1

    How to Fix Error Code 0x3000008 for Remote Desktop Connection

  • fix error code 0x80190001 1

    How to Quickly Fix Error 0x80190001 for Microsoft or Outlook Account Login 

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.

© 2025 Guiding Tech Media All Rights Reserved

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

© 2025 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