Hi,
I'm working on a project trying to parse the contents of the zones and records.
I'm using the below command to get the data in the json format.
Get-DnsServerResourceRecord -ZoneName test.com|ConvertTo-Json
The command works fine for small amount of data, but when I try to extract info of a zone which consists of thousands of records, I'm encountering the below issue.
Generic failure
At line:1 char:1
- Get-DnsServerResourceRecord -ZoneName test.com|ConvertTo ...
-
+ CategoryInfo : NotSpecified: (PS\_DnsServerResourceRecord:root/Microsoft/...rResourceRecord) [Get-DnsServerResourceRecord], CimException
+ FullyQualifiedErrorId : HRESULT 0x80041001,Get-DnsServerResourceRecord
ConvertTo-Json : Exception of type 'System.OutOfMemoryException' was thrown.
At line:1 char:61
- ... nsServerResourceRecord -ZoneName test.com|ConvertTo-Json
-
~~~~~~~~~~~~~~
- CategoryInfo : NotSpecified: (:) [ConvertTo-Json], OutOfMemoryException
- FullyQualifiedErrorId : System.OutOfMemoryException,Microsoft.PowerShell.Commands.ConvertToJsonCommand
What would be the solution to this problem? I need the data in json format only, since I have my project written based on parsing the data.
If anyone has a better solution to this, please let me know. Thanks in advance.