How to export dns via powershell

Опубликовано: 17 Октябрь 2024
на канале: It System
2,406
19

This section describes how to export dns records via powershell.
Dns records you can import all your dns records as excel through this command. Don't forget to subscribe to my channel.

Powershell Command
$dnszones = Get-DnsServerZone | Select ZoneName
ForEach ($zone in $dnszones) { $data = New-Object System.Object
$ZoneName = $Zone.ZoneName
$data = Get-DnsServerResourceRecord $ZoneName
$data | Add-Member -MemberType NoteProperty -Name "ZoneName" -Value $ZoneName
$data += $data
$data | Select ZoneName, HostName, RecordType | Export-Csv -NoTypeInformation c:\temp\DNSRecords.csv -Append
}


  / itsystem.tech  
http://www.itsystem.tech