Remote server administration
**1. How to change the preferred DNS server IP? **
How to connect the server remotely?
C:\psexec \<servername> cmd
Download the pstools.
http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx
How to check the current IP settings?
C:\WINDOWS\system32>netsh interface ip show config
or
C:\wmic /node:10.224.34.50 nicconfig get dnsserversearchorder
How to change the preferred DNS server IP?
C:\WINDOWS\system32>netsh interface ip set dns "Local Area Connection" static 192.15.25.1
or
C:\wmic /NODE:10.224.34.50 nicconfig where (IPEnabled=TRUE and DHCPEnabled=FALSE) call SetDNSServerSearchOrder (192.168.254.101,192.168.254.100?)
For brief discussion see the below links.
http://www.petri.co.il/configure_tcp_ip_from_cmd.htm
http://blog.scottlowe.org/2006/07/07/setting-dns-and-wins-server-addresses-remotely/
More WMI query for Remote server administration
wmic /node:SERVER1, SERVER4 cpu get name, caption,maxclockspeed, systemname /format:textvaluelist.xsl
wmic /output:C:\Proc.htm CPU get Description, DeviceID, Manufacturer, MaxClockSpeed, Name, Status, SystemName /format:hform.xsl
wmic netlogin get Name, LogonServer
(shutdown events tracker)
**wmic /output:C:\reboot.htm ntevent where (LogFile='system' and SourceName='user32') get Message, TimeGenerated /format:hform.xsl
**
wmic csproduct get name