none
Finding DNS Forwarders and DNS Conditional Forwarders in Forest

    Question

  • Hi Techies,

    Please give me simple solution where i can find all my DNS Forwarders and DNS Conditional Forwarders in Forest. 

    I do not want to login each DNS server ---> Navigate the forwarders and Conditional forwarder to check details.

    Instead want some script or powershell command  to find all details in one server with exporting in csv or txt format.

    I have tried powershell script

    $NS = Resolve-DnsName -Name domain.tld -Type NS | `
        Where {$_.Type -eq 'NS'} | `
        Select-Object -ExpandProperty NameHost

    $output = foreach ($server in $NS) {
        $forwarders = Get-DNSServer -ComputerName $server | `
                      Select-Object -ExpandProperty ServerForwarder | `
                      Select-Object -ExpandProperty IPAddress | `
                      Select-Object -ExpandProperty IPAddressToString

        foreach ($forwarder in $forwarders) {
            $props = @{'DNSServer' = (Resolve-DNSName -Name $server).Name ; 
                       'Forwarder' = $forwarder}
            $obj = New-Object -TypeName PSObject -Property $props
            Write-Output $obj
        }
    }

    BUT IT REQUIRE WINDOWS 2012 OR WINDOWS 8.  Where as i m using only windows 2008 server.



    With Regards, Raviraj Nagenhatti - System Administrator

    Tuesday, September 15, 2015 1:30 PM

Answers