none
Add-DnsServerSecondaryZone Multiple MasterServers RRS feed

  • Question

  • # Primary DNS Server to be used to create secondary zones
    $DNSServer = "server1"
    $MasterServers = @("10.0.0.1","10.0.0.2",10.0.0.3")
    
    Write-Host -ForegroundColor DarkYellow "Querying '$DNSServer' for Primary Zones and Creating Secondary Zones on '$env:ComputerName'"
    Get-DnsServerZone -ComputerName $DNSServer | where {("Primary" -eq $_.ZoneType) -and ($False -eq $_.IsAutoCreated) -and ("TrustAnchors" -ne $_.ZoneName)} | foreach { $_ | Add-DnsServerSecondaryZone -MasterServers $MasterServers -ZoneFile "$($_.ZoneName).dns"}
    Write-Host -ForegroundColor DarkYellow "Querying '$DNSServer' for Primary Zones and Creating Secondary Zones on '$env:ComputerName'"

    Hi 

    Is there a way to add multiple master servers with the command Add-DnsServerSecondaryZone -MasterServers. I've found the parameter -MasterServers can't accept multiple values

    I'm looking for a way to create the secondary zones but specify multiple master servers instead of just one entry

    Any thoughts?

    Kind Regards



    • Edited by exchinfo Thursday, October 24, 2019 2:34 PM
    Thursday, October 24, 2019 2:33 PM

All replies

  • Always start with the help for the command you are trying to use.

    The command takes an array of IP addresses.

    help Add-DnsServerSecondaryZone -full

    Read the whole help carefully and read the parameter in question.


    \_(ツ)_/

    Thursday, October 24, 2019 5:01 PM