1. Download & Run PSexec to execute remote commands:

http://techsultan.com/remotely-change-ip-settings-on-windows-xpvista7-using-netsh/

2. Run the required NetSH commands

http://windowsitpro.com/networking/network-configuration-tasks-netsh



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=192.168.0.1 gw=0
  • Change ip, netmask and default gateway on Windows Vista/7/8 : netsh interface ip set address “Local Area Connection” static 192.168.0.10 255.255.255.0 192.168.0.1
  • Change main DNS server : netsh interface ip set dns “Local Area Connection” static 192.168.0.1
  • Add a second DNS server : netsh interface ip add dns “Local Area Connection” static 192.168.0.2