Extracting all DNS zones information.

Using below script you can extract all zone names hosted on a windows DNS server, their AD integration status and the list of Master server IPs in case zone is not AD integrated. Please don’t forget to replace Server1 with your windows DNS server name.

1
2
3
4
5
6
7
8
$source = "Server1"
$zones = Get-DnsServerZone -ComputerName $source -WarningAction Ignore | Select-Object -Property ZoneName, ZoneType, IsDsIntegrated
foreach ($zone in $zones){
If ($zone.IsDsIntegrated -eq $false) {
$master = (Get-DnsServerZone -Name $zone.ZoneName -ComputerName $source | Select-Object -Property MasterServers -ExpandProperty MasterServers).IPAddressToString
Write-Host $zone.ZoneName '|' $zone.ZoneType '|' $zone.IsDsIntegrated '|' $master
}
}

Be the first to comment

Leave a Reply

Your email address will not be published.


*