1. Download & Run PSexec to execute remote commands:


2. Run the required NetSH commands


Make sure about the name of the Adaptor - Server 2012 by default is "Ethernet" and not "Local Area Connection"

psexec.exe \\computername -u computername\administrator cmd.exe

It should then ask you for administrator password, and then spawn process.  From there you can start playing with netsh as like you are on the remote computer, here a main command lines for netsh control :

  • Display IP configuration : netsh interface ip show config
  • Change default gateway on Windows XP : netsh interface ip set address “Local Area Connection” gateway= gw=0
  • Change ip, netmask and default gateway on Windows Vista/7/8 : netsh interface ip set address “Local Area Connection” static
  • Change main DNS server : netsh interface ip set dns “Local Area Connection” static
  • Add a second DNS server : netsh interface ip add dns “Local Area Connection” static