Can't get Get-DnsServerResourceRecord to return records

I’m trying to work with the DNSServer module and am on a Utility server that has access to our DC (DCS001).

My Utility server has Powershell 5.1 installed and I see all of my DNS cmdlets. I can also load up the dnsmgmt.msc snapin and view DCNS records for all domains

But when I simply attempt to run:

Get-DnsServerResourceRecord -ComputerName “DCS001” -ZoneName “” -RRType A

…I get and error

Get-DnsServerResourceRecord : Invalid namespace 

What am I missing? I’ve tried various other Zones for the -ZoneName parameter but same error.

Thank you

Works fine for me from my admin server to the DC.

I would be inclined to think it’s a connection issue between your utility server and the DC. Looks like that cmdlet might use CIM as the connection, can you start a PS Session to the DC?

What OS is your utility server, what OS is the DC?

Utility server: Server 2008 R2 (PS v 5.1)
Domain Controller: Server 2008 R2 (PS v 4)

I was able to start a New-PSSession to the DC. Can’t run DNSServer cmdlets there however because it’s only PS 4 ?

But shouldn’t I be able to run DNSServer cmdlets from my Util server that already has them loaded?

You must implicitly or explicitly connect to a server with the DNS role or the RSAT DNS tools loaded.
PSv4 is not the issue. As noted the result form one of my DNS servers WS2012R2 running PSv4.

(Get-CimInstance -ClassName Win32_OperatingSystem).Version


Get-WindowsFeature -Name '*DNS*'

Display Name                                            Name                       Install State
------------                                            ----                       -------------
[X] DNS Server                                          DNS                            Installed
        [X] DNS Server Tools                            RSAT-DNS-Server                Installed

Get-DnsServerResourceRecord -ComputerName $env:COMPUTERNAME -ZoneName $env:USERDNSDOMAIN -RRType A

HostName                  RecordType Timestamp            TimeToLive      RecordData
--------                  ---------- ---------            ----------      ----------
@                         A          4/8/2017 ...                                    
@                         A          9/25/2018 ...                                      
adfs                      A          0        ...                                    
DomainDnsZones            A          9/25/2018 5...                                      
ForestDnsZones            A          9/25/2018 ...                                     

If you know the all the above DNS host is valid and they are still not running, then you have somehtinbg else working against you in your environment.

My Util server has the following:

(Get-CimInstance -ClassName Win32_OperatingSystem).Version




Get-WindowsFeature -Name '*DNS*'

Display Name                                            Name                   
------------                                            ----                   
[ ] DNS Server                                          DNS                    
        [X] DNS Server Tools                            RSAT-DNS-Server

If you click “Windows 10 and Windows server…” in the top left hand corner of the above link you will see that it lists 2012 as the minimum operating system for it to work.

I am sure you are aware 2008R2 is end of life in 14 months, time to start upgrading!

yeah I’m sure the team is upgrading those servers’ OS’s (I’m a contractor).

So, even if my Utility server has the latest PS, and the DNSServer module loads, and I use the -ComputerName parameter to point to a DC with DNS records, I still won’t get records returned?


You have to have the minimum supported operating system.

ok I see now. I tried on a 2012 DC and see results,

Thanks everyone