You may modify the following Microsoft PowerShell (.ps1) script to configure the Internet Protocol (IP) and Domain Name System (DNS) servers for a Network Interface Card (NIC) in Windows Server 2012 R2.
Microsoft Windows PowerShell – Configure IP Address(es) and DNS Server(s)
January 28, 2014
Noel Alvarez