I'm writing a Powershell script and am querying the local DNS resource for both CNAME and A records matching specific criteria (specifically against HP servers). Using full administrator access rights using WQL against the root\MicrosoftDNS provider, I was presented with 0 records for the following:
select * from MicrosoftDNS_ResourceRecord where TextRepresentation like '%sql%'
However, negating a negation works.
select * from MicrosoftDNS_ResourceRecord where NOT(NOT(TextRepresentation like '%sql%'))
Why? Am I going insane?
The full query is:
select * from MicrosoftDNS_ResourceRecord where NOT (ContainerName like '..%' OR OwnerName like '%ilo%') AND (__CLASS = 'MicrosoftDNS_AType' OR __CLASS = 'MicrosoftDNS_CNAMEType') AND NOT(NOT(TextRepresentation like '%sql%'))