Server 2012 R2 DNS Powershell Help!

Zetro

Limp Gawd
Joined
Dec 2, 2005
Messages
296
Hey everyone,

I am trying to write some scripts to change the zone transfer and notify servers for around 1000 internal zones but the Microsoft technet articles on these commands are lacking a lot on the syntax.

I was hoping that someone could point out how to do the spacing on the IP addresses in these commands so on each zone the zone transfer and notify servers are updated :)

Set-DnsServerPrimaryZone -Name “mydomain.com” –Notify Notifyservers –notifyservers “172.30.4.244 172.30.5.66 172.30.6.38 172.30.36.127 172.30.37.93 172.30.38.167" -SecondaryServers “172.30.4.244,172.30.5.66,172.30.6.38,172.30.36.127,172.30.37.93,172.30.38.167”

I have tried spaces, spaces with commas, and commas directly with no results.

https://msdn.microsoft.com/en-us/library/jj649865.aspx

This is the article that I am referencing
 
and yes I know the IP addresses in the above string are in different syntax, was trying every combination possible lol
 
Try doing the servers as an object as just do a foreach for the list
 
$notifyarray = “172.30.4.244", "172.30.5.66", "172.30.6.38", "172.30.36.127", "172.30.37.93", "172.30.38.167"

$secondarray = "172.30.4.244","172.30.5.66","172.30.6.38","172.30.36.127","172.30.37.93","172.30.38.167”

Set-DnsServerPrimaryZone -Name “mydomain.com” –Notify Notifyservers –notifyservers $notifyarray -SecondaryServers $secondarray
 
Back
Top