Created
January 24, 2019 13:45
-
-
Save spy86/8f26d7aeb226438f41cab65c6ea817b0 to your computer and use it in GitHub Desktop.
DNS, Sites & Services, and Time Keeping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Define DNS and Sites & Services Settings | |
| $IPv4netID = "10.10.100.0/24" | |
| $siteName = "LAB" | |
| $location = "New Lab City" | |
| # Define Authoritative Internet Time Servers | |
| $timePeerList = "0.us.pool.ntp.org 1.us.pool.ntp.org" | |
| # Add DNS Reverse Lookup Zones | |
| Add-DNSServerPrimaryZone -NetworkID $IPv4netID -ReplicationScope 'Forest' -DynamicUpdate 'Secure' | |
| # Make Changes to Sites & Services | |
| $defaultSite = Get-ADReplicationSite | Select DistinguishedName | |
| Rename-ADObject $defaultSite.DistinguishedName -NewName $siteName | |
| New-ADReplicationSubnet -Name $IPv4netID -site $siteName -Location $location | |
| # Re-Register DC's DNS Records | |
| Register-DnsClient | |
| # Enable Default Aging/Scavenging Settings for All Zones and this DNS Server | |
| Set-DnsServerScavenging –ScavengingState $True –ScavengingInterval 7:00:00:00 –ApplyOnAllZones | |
| $Zones = Get-DnsServerZone | Where-Object {$_.IsAutoCreated -eq $False -and $_.ZoneName -ne 'TrustAnchors'} | |
| $Zones | Set-DnsServerZoneAging -Aging $True | |
| # Set Time Configuration | |
| w32tm /config /manualpeerlist:$timePeerList /syncfromflags:manual /reliable:yes /update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment