MicrosoftDNS powershell sample code
The foundations for Manageability in Windows is Windows Management Instrumentation (WMI; formerly WBEM) and WMI extensions for Windows Driver Model (WDM).
ActiveXperts Network Monitor provides the ability to build monitor check routines based on WMI. ActiveXperts has collected more than a hundred WMI samples. You can use these samples as a base for new check routines you can write yourself. The MicrosoftDNS WMI class can be used in ActiveXperts Network Monitor to monitor your servers.
Sample Code
$strComputer = "." $objWMi = get-wmiobject -namespace root\MicrosoftDNS -computername localhost -Query "Select * from MicrosoftDNS_AType" foreach ($obj in $objWmi) { write-host "Caption:" $obj.Caption write-host "ContainerName:" $obj.ContainerName write-host "Description:" $obj.Description write-host "DnsServerName:" $obj.DnsServerName write-host "DomainName:" $obj.DomainName write-host "InstallDate:" $obj.InstallDate write-host "IPAddress:" $obj.IPAddress write-host "Name:" $obj.Name write-host "OwnerName:" $obj.OwnerName write-host "RecordClass:" $obj.RecordClass write-host "RecordData:" $obj.RecordData write-host "Status:" $obj.Status write-host "TextRepresentation:" $obj.TextRepresentation write-host "Timestamp:" $obj.Timestamp write-host "TTL:" $obj.TTL write-host write-host "########" write-host }