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 “corp.com” -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.
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?
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
6.3.9600
($PSVersionTable).PSVersion.Major
4
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.
(Get-CimInstance -ClassName Win32_OperatingSystem).Version
6.1.7601
($PSVersionTable).PSVersion.Major
5
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?