Exporting DNS console to .CSV file using PowerShell or any means necessary?

Hi All,

Using Windows Server 2012 R2 and Windows Server 2012 DNS console or PowerShell,

I need to export the list of DNS forward lookup zones and also the Conditional forwarders in my DNS Management console to .CSV so I can compare it between two DNS server in different AD domains.

Any help and suggestion would be greatly appreciated.


Thank in advance.

Hmmm … have you already searched for it?


What help do you expect/need?

When I execute the below script:

$DNSServer = "servernameOrIp" $Zones = @(Get-DnsServerZone -ComputerName $DNSServer) ForEach ($Zone in $Zones) { Write-Host "`n$($Zone.ZoneName)" -ForegroundColor "Green" $Results = $Zone | Get-DnsServerResourceRecord -ComputerName $DNSServer echo $Results > "$($Zone.ZoneName).txt" }
I get the error:
Get-DnsServerZone : The term 'Get-DnsServerZone' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:2 char:12 + $Zones = @(Get-DnsServerZone -ComputerName $DNSServer) + ~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-DnsServerZone:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

Have you installed the DNSServer PowerShell module on your local machine (or the machine you’re running the command on)?

It it likely to be in the Windows RSAT, if you haven’t.

DNSServer module comes when the feature is enabled, make sure its enabled otherwise, as mentioned above you can make use of RSAT or you can use implicit remoting as well.

OK, It seems the remoting is working great for me.

Thanks all for the sharing and the solutions.