Friday, July 19, 2019

DNS Bulk Import to Subdomain

  1. The subdomain in this example is "network". Making the FQDN for a device something like...switch1.network.mydomain.com.
  2. Using -CreatePTR means you don't have to run separate commands to create the reverse lookups like you would with DNSCMD.
*We opted to keep our network devices in their own container for easier management.

Just get a csv and away you go.

###############################
$nodes = Import-Csv C:\temp\networknodelist.csv

foreach($node in $nodes)
{
    $name = $node.name + ".network"
    Add-DnsServerResourceRecordA -zonename mydomain.com -name $name -ipv4 $node.ip -CreatePtr
}
###############################

No comments:

Post a Comment