I am trying to retrieve a single A Record from a zone. Here's the Powershell command I am using(showing only relevant columns)
Get-DnsServerResourceRecord -zonename search.contoso.com -computername g-dc03 -RRType A
HostName RecordType RecordData
-------- ---------- ----------
@ A 192.23.12.40
stg A 172.25.77.56
In the "DNS Manager" GUI, I see the first record as "same as parent folder". I would like to retrieve just this one record, not the stg record. I tried and failed with the following commands, all of them result in same 2 rows.
Get-DnsServerResourceRecord -zonename search.contoso.com -computername g-dc03 -RRType A -Name "."
Get-DnsServerResourceRecord -zonename search.contoso.com -computername g-dc03 -RRType A -Name '.'
Get-DnsServerResourceRecord -zonename search.contoso.com -computername g-dc03 -RRType A -Name search.contoso.com
HostName RecordType RecordData
-------- ---------- ----------
search.contoso.com A 192.23.12.40
stg A 172.25.77.56
If I understand you correctly, you want something like this
You can replace
@
with any search term, or you can change the-like '@'
to-notlike 'stg'
to list all A records other then thestg
recordIf that isn't what you are looking for please post a comment and I will amend accordingly
EDIT: Doing the same without
where