i would like to query DNS for records that have the security of a the PC so I can delete them all.
I have gotten to the point where i can get the record as an object, but need to know the method to call to query the security.
$serverName = "DNSServerName"
$ContainerName = "zone.com"
$RecordName = "PC1234.zone.com"
PS C:\WINDOWS> $Record = Get-WMIObject -Computer $ServerName -Namespace "root\MicrosoftDNS" -Class "MicrosoftDNS_AType" '
-Filter ContainerName='$ContainerName' AND OwnerName='$RecordName'"
$Record
Will return:
__GENUS : 2
__CLASS : MicrosoftDNS_AType
__SUPERCLASS : MicrosoftDNS_ResourceRecord
__DYNASTY : CIM_ManagedSystemElement
__RELPATH : MicrosoftDNS_AType.ContainerName="zone.com",DnsServerNam
e="DNSServer.zone.com",DomainName="Domain.com",OwnerName=
"PC1234.zone.com",RecordClass=1,RecordData="10.1.2.123"
__PROPERTY_COUNT : 15
__DERIVATION : {MicrosoftDNS_ResourceRecord, CIM_LogicalElement, CIM_Mana
gedSystemElement}
__SERVER : DNSServer
__NAMESPACE : root\MicrosoftDNS
__PATH :
\\DNSServer\root\MicrosoftDNS:MicrosoftDNS_AType.ContainerN
ame="zone.com",DnsServerName="DNSServer.zone.com",Domai
nName="domain.com",OwnerName="PC1234.zone.com",RecordCla
ss=1,RecordData="10.1.2.123"
Caption :
ContainerName : zone.com
Description :
DnsServerName : DNSServer.zone.com
DomainName : domain.com
InstallDate :
IPAddress : 10.1.2.123
Name :
OwnerName : PC1234.zone.com
RecordClass : 1
RecordData : 10.1.2.123
Status :
TextRepresentation : PC1234.zone.com IN A 10.1.2.123
Timestamp : 3596417
TTL : 900
I think it is not possibly to do this, but since there are some super smart people out there I am hoping for the best.
Thanks for any help,
Denis