Last active
September 12, 2019 00:09
-
-
Save jhawkwind/47e466966cd757000371254e4f82e659 to your computer and use it in GitHub Desktop.
PowerShell DNS commands
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
| This will set all Forward Lookup Zones with the following attributes: | |
| - No Dynamic Updates | |
| - Notify Secondaries of change to all NS Secondaries | |
| - Allow Zone Transfer to NS Secondaries | |
| Get-DnsServerZone | Where-Object {$_.ZoneType -like "Primary" -and $_.IsReverseLookupZone -eq $False} | Select-Object -Property ZoneName,ZoneType | Set-DnsServerPrimaryZone -DynamicUpdate None -Notify Notify -SecureSecondaries TransferToZoneNameServer | |
| Create Secondaries based upon the primary: | |
| Get-DnsServerZone -ComputerName win-olpn33s5q3m.mytest.contoso.com | where {("Primary" -eq $_.ZoneType) -and ($False -eq $_.IsAutoCreated) -and ("TrustAnchors" -ne $_.ZoneName)} | %{ $_ | Add-DnsServerSecondaryZone -MasterServers 172.23.90.136 -ZoneFile "$($_.ZoneName).dns"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment