Hi all,
I’m trying to get a list of static DNS A Records. I’ve tried doing a double filter, adding a Where-object statement at the end of this line, but everything errors out on me. I also thought about putting the results of this into a variable, and then running an IF statement, but that didn’t work either. Get-dnsserverresourcerecord only returns the hostname, and I need the FQDN that this line returns. Does anyone know what I should add to the following line to get this to work? $zonename is variable that’s working fine. If the one line can’t do what I’m looking for, can you point me in the right direction? TIA
Get-WmiObject -Class MicrosoftDNS_AType -NameSpace Root\MicrosoftDNS -ComputerName 192.168.1.1 -Filter "DomainName = '$zonename'" | Select-Object -property Ownername, IPAddress, Timestamp