Get-DNSRecord: Critical error

Mar 5, 2012 at 12:22 PM


First of all, thank you for these awsome set of cmdlets ... I think they could save me lot of time :o)

But I have a little problem doing a cleaning task of my reverse zone. I have a reverse zone that contains about 180 000 records and I need to get the records that has a record timestamp less than (now - 14Days). The command I use is:

$OldDate = (get-date).Subtract($(new-timespan -Days 14))
get-DnsRecord -RecordType PTR -ZoneName "" -Server | wherer{$_.TimeStamp -lt $oldDate}

This command returns some results but after a little while I got the error:

Get-DnsRecord: Critical error
At line:1 char:14
+ get-DnsRecord <<<<   -Recordtype PTR -ZoneName "" -Server
   + CategoryInfo                    : NotSpecified:  (:]  [get-DnsRecord],  ManagementException
    +  FullyQualifiedErrorId       : System.Management.ManagementException,DnsShell.PowerShell.CmdLet.DnsRecord

In a previous post you said that using Get-ADDnsRecord give the same result, but I only got the @ record when launching

Get-ADDnsRecord -SearchRoot ",CN=MicrosoftDNS,DC=InternalDNSZones,DC=Contoso,DC=Com" -Server

Has someone already have this kind of trouble?
Is there some limitation with the Get-DNSRecord ?

Thanks in advance for your answer