$DNSEntrys = import-csv “h:\dns.csv”
ForEach ($dns in $DNSEntrys){
$hostname = $($dns.hostname)
$ipaddress = $($dns.ipaddress)
Write-host $hostname $ipaddress
Add-DnsServerResourceRecordA -Name $hostname -IPv4Address $ipaddress -ZoneName contoso.com -ComputerName dc01 -CreatePtr
}
DNS
All posts tagged DNS
$Subnets = Get-Content "C:\Temp\subnets.txt"
foreach ($subnet in $subnets)
{
write-host "Subnet: $subnet" Add-DnsServerPrimaryZone -DynamicUpdate Secure -NetworkId "$subnet" -ReplicationScope Domain
}