Table of Contents



Get the IPs

$DNSServers = cat C:\scripts\DCs.txt
$ErrorActionPreference = "Stop"
foreach ($DNSServer in $DNSServers)
{
Try{
[PSCustomObject]@{
#Get-DnsServerZone -ComputerName $DNSServer -Name test.com,test.net | Select-Object Masterservers,Zonename
DNSServer = $DNSServer
Zone_Name = Get-DnsServerZone -ComputerName $DNSServer -Name test.com | Select-Object -ExpandProperty Zonename
Master_Servers = Get-DnsServerZone -ComputerName $DNSServer -Name test.com | Select-Object -ExpandProperty Masterservers
}
 }
catch
{
Write-Host "That Conditional forwarder is not availablle in $DNSServer" -ForegroundColor White -BackgroundColor Red
 
}
 }


Modify the IPs