Reputation: 921
I wrote a script to query DNS for IP address and host-names, this works great but I'd like to further prune my data and only show results of IP address 10.9.x.x, does anyone know a good way to do this?
get-wmiobject -ComputerName DNSServer -Namespace root\microsoftDNS -Class MicrosoftDNS_ResourceRecord -Filter "domainname='contoso.local'"| select ipaddress, ownername |sort ownername
Upvotes: 0
Views: 780
Reputation: 200563
Filter the result using the Where-Object
cmdlet (alias ?
):
... | select ipaddress, ownername | ? { $_.ipaddress -like '10.9.*' } |
sort ownername
Upvotes: 1