Monday, May 23, 2016

Powershell Script to set DNS Servers

Your DNS servers have changed.  Your servers have statically set IP addresses and you need to update the DNS entries.  You have a bunch of servers and don't want to do this manually.  This script will run through a text file that you created with all your servers in it.

Assumptions:  You have a file called servers.txt that contains a list of your servers (one on each line).

Copy the text below and paste into a text editor.
Change the line $DNSServers and put in the addresses you want.
Save the file as:  SetDNS.ps1
Open up a powershell window and run.
Check your servers DNS settings to confirm.

No comments:

Post a Comment