I'm trying to query the RecordData property of a zone I've retrieved using Get-DnsServerResourceRecord. If I query any of the other elements things work fine, so for instance I can run :
$records=getdnsserverrecourcerecord -zonename "mydomain.com" | where-object {$_.RecordType -eq "A"} $records
and I get all the A records in mydomain.com. However if I try the same thing using $_.RecordData I don't get any records returned.
I've found that unlike the other properties that are all strings, the RecordData property is a CimInstance#Instance type.
How do I query the data stored in a property of this type? I've seen mention of some sub-properties in there, for instance HostNameAlias and IPv4Address, but those have been mentioned offhand on the few pages I've found that mention RecordData without any explanation behind them.
Ultimately I want to be able to search the zone for any records that contain a given hostname or IP address, but from what I've found I guess I may been slightly different queries depending on the type of data I'm searching for. At this stage I can't even work out how to determine the structure of CimInstance#Instance, or how to do the most basic of query against it. Unfortunately almost all mention of CimInstance online seems to relate to connecting to remote machines and WMI calls with the previous versions of PowerShell.