none
Change DNS Servers on all servers RRS feed

  • Question

  • We are about to upgrade our domain from Windows 2008 R2 to Windows 2012 R2. As DNS also installed on DCs, we need to change DNS servers' IP addresses on all servers (Windows 2008, 2008 R2, 2012, 2012 R2) in domain.

    Would someone direct me good resource for PowerShell script to update all servers' DNS IP addresses ( primary and secondary) remotely?

    Thanks in advance for your help


    Tek-Nerd

    Monday, April 25, 2016 12:17 PM

Answers

All replies

  • TechNet gallery has quite a few DNS scripts to choose from. Try this query

    Gleb.

    • Proposed as answer by Hello_2018 Tuesday, April 26, 2016 6:31 AM
    • Marked as answer by Leo HanModerator Thursday, May 5, 2016 8:19 AM
    Monday, April 25, 2016 12:29 PM
  • Thank You,

    As we have different versions of Windows servers ( 2008 to 2012 R2) with different PowerShell versions, I wonder if single script works for all servers or do we need different syntaxes.


    Tek-Nerd

    Monday, April 25, 2016 6:39 PM
  • I have started a Wiki about this here: http://social.technet.microsoft.com/wiki/contents/articles/20527.central-management-of-dns-configuration-compliance-and-updates.aspx

    This posting is provided AS IS with no warranties or guarantees , and confers no rights.

    Ahmed MALEK

    My Website Link

    My Linkedin Profile

    My MVP Profile

    • Proposed as answer by Hello_2018 Tuesday, April 26, 2016 6:31 AM
    • Marked as answer by Leo HanModerator Thursday, May 5, 2016 8:19 AM
    Monday, April 25, 2016 11:14 PM
  • Hi Tek-Nerd,

    >>Would someone direct me good resource for PowerShell script to update all servers' DNS IP addresses ( primary and secondary) remotely?

    Besides of Mr X & Gleb's view.

    I suppose we don't need to use a script to do this, just using some simple commands to achieve this purpose:

    On one of your DCs, you could add these servers into one server group, then right-click them, choosing "windows powershell"->enter netsh>interface->ipv4>add dnsservers command to modify the dns settings on the target computers.

    Or, we could do like this:

    cmd->powershell(run as admin)->enter-possession -computerName server2008 -credential(get-credential)->enter user name and password->netsh>interface>ipv4>adddnsservers

    Every time we want to modify the dns settings on the target we only need to modify the serverName and enter the appropriate user name and password.(if all of these servers are on the same domain, I suppose this issue will be more simple, just using one user account)

    For more info about netshe, please refer to link below:

    https://technet.microsoft.com/en-us/library/bb490943.aspx?f=255&MSPPError=-2147217396

    Best regards,


    Andy_Pan

    Tuesday, April 26, 2016 6:30 AM