Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
This script will set up AD integrated DNS forward and reverse lookup zones
You need a Windows Server 2012 R2 for this script to work.
This script is part of a series to automate your lab on
#Requires -Version 3
#Requires -RunAsAdministrator
### Variables
$Zone = 'dominik.lab'
$NetworkID = ''
$ScavengeServer = ''
$ZoneAgingName = ''
Set-DnsServerPrimaryZone –Name $Zone –ReplicationScope 'Forest'
Set-DnsServerScavenging –ScavengingState $True –RefreshInterval 7:00:00:00 –NoRefreshInterval 7:00:00:00 –ScavengingInterval 7:00:00:00 –ApplyOnAllZones –Verbose
Set-DnsServerZoneAging $Zone –Aging $True –NoRefreshInterval 7:00:00:00 –RefreshInterval 7:00:00:00 –ScavengeServers $ScavengeServer –PassThru –Verbose
Add-DnsServerPrimaryZone –ReplicationScope 'Forest' –NetworkId $NetworkID –DynamicUpdate Secure –PassThru –Verbose
Set-DnsServerZoneAging -Name $ZoneAgingName –Aging $True –NoRefreshInterval 7:00:00:00 –RefreshInterval 7:00:00:00 –PassThru –Verbose
Throw $_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.