• New Script: Set-DNSScavengeServer

    November 1, 2019

    DNS, PowerShell

    I do a lot of Active Directory Health Check and Remediation projects. Going all the way back to my first conference presentation, 95% of Active Directory (AD) issues trace their roots to DNS. One of the DNS culprits is not having DNS Aging and Scavenging configured correctly. This new script will configure the DNS scavenging server for every Active Directory-integrated Forward and Reverse Lookup Zone.

    I have been meaning to write this script for a number of years, but never got around to it. Well, I finally got my “Round ToIt”.

    RoundToIt
    RoundToIt

    I was working on an AD remediation project where the customer had over 100 AD-integrated Forward and Reverse Lookup Zones to configure. I did not want to issue over 100 “dnscmd” commands, copying and pasting the name of every zone.

    DNS Aging and Scavenging is configured in five places.

    1. DNS Server
    2. DNS Server Properties
    3. Forward Lookup Zones
    4. Reverse Lookup Zones
    5. Then via dnscmd.exe, set a scavenging server for every Forward and Reverse Lookup Zone

    This new script handles item number five.

    As with all my scripts, there is full help text available.

    Since Microsoft only started supplying DNS PowerShell cmdlets with Windows Server 2012, PowerShell V4 or later is required. At least one Windows Server 2012 or later is required. Windows 8, or later, with Remote Server Administration Tools is required is you want to run the script from a non-server.

    Because this script makes changes to DNS, there is support for -WhatIf and -Confirm.

    The script creates a text file that contains the Before and After settings.

    Figure 1
    Figure 1
    Figure 2
    Figure 2
    Figure 3
    Figure 3
    Figure 4
    Figure 4
    Figure 5
    Figure 5
    Figure 6
    Figure 6

    For the customer with over 100 zones to configure, running the script took less than five seconds.

    If there is anything you would like added to the script, send me an email to webster@carlwebster.com.

    As always, thanks to Michael B. Smith for the code review, corrections, and suggestions.

    You can always find the most current script by going to https://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

    Thanks

    Webster







    About Carl Webster

    Webster is a Sr. Solutions Architect for Choice Solutions, LLC and specializes in Citrix, Active Directory and Technical Documentation. Webster has been working with Citrix products for many years starting with Multi-User OS/2 in 1990.

    View all posts by Carl Webster

    No comments yet.

    Leave a Reply