Change Windows IP address settings remotely with psexec and netsh

Download psexec from Sysinternals / MS. It only needs to be installed on the machine you run the commands from, not the targets.

Note:
* All machines must be in the same domain or workgroup
* Firewalls must be down on the targets (haven’t checked exactly which ports, so lowered them for domain access in my case)
* Ideally, create/use a local admin user on each remote machine for execution

Change from DHCP to static IP (note the “-h” for elevated admin access):
psexec \\<remote-computer-name> -u <remote-admin-user> -p <password> -h netsh interface ip set address name=”<interface-name>” static addr=<ip> <mask> <gateway> 1

Since the IP change command doesn’t include DNS settings we also need the the below:

Change DNS settings:
psexec \\<remote-computer-name> -u <user> -p <password> -h netsh interface ip set dns name=”<interface-name>” static addr=<ip>

Example changing the settings remotely on a Japanese Windows 7 machine from a Windows 2012 R2 server:
psexec \\Win7-01 -u admusr -p Passw0rd! -h netsh interface ip set address name=”ローカル エリア接続 2″ static addr=192.168.0.100 255.255.255.0 192.168.0.1 1

psexec \\Win7-01 -u admusr -p Passw0rd! -h netsh interface ip set dns name=”ローカル エリア接続 2″ static addr=8.8.8.8

 

Tip:
If you’re uncertain of the interface name: Run “ipconfig” remotely and copy and paste the interface name from there.
psexec \\<remote-computer-name> -u <remote-admin-user> -p <password> ipconfig

 

Hyper-V Error (23001) Cannot create or update a non highly available virtual machine

OK, so you created a Hyper-V cluster using clustered, shared storage (CSV) and installed SCVMM. Now when you try to deploy a VM to a cloud it won’t work. Your clouds are listed with zero stars for compatibility and the below, rather cryptic, error message will be shown:

Full Error message:
Error (23001) Cannot create or update a non highly available virtual machine because the path C:\ClusterStorage\Volume1\Virtual Hard Disks\ is a clustered resource. Recommended Action Ensure that the path exists and that the path is not a cluster disk or cluster shared volume, and then try the operation again.

Fix:
This happens if the cloud is configured to use clustered storage but the VM hardware profile doesn’t have a check in the “Make this virtual machine highly available” checkbox.

Thank you for the useful error messages MS. They really make me want to pull my hair out.

Hyper-V_HA

Enabling SNMP on a Dell MXL blade switch (running FTOS)

It’s very easy to enable SNMP 1.0 / 2.0 management of the Dell MXL blade network switches. All it takes is one command really (“snmp-server community public ro”).

SSH to the network switch (MXL):
jonas@nyx:~$ ssh root@10.1.1.100
root@10.1.1.100’s password:

Verify that there is no current SNMP configuration present:
TOKSCA4A2-MXL#show running-config snmp

Enter config mode and enable your community name – in this case “public” and specify if it’s Read-Only or Read-Write. In this case we use read only (ro):
TOKSCA4A2-MXL#conf
TOKSCA4A2-MXL(conf)#snmp-server community public ro
TOKSCA4A2-MXL(conf)#end

Verify that it worked:
TOKSCA4A2-MXL#show running-config snmp
!
snmp-server community public ro
TOKSCA4A2-MXL#

All done! Add the switch to your SNMP manager (OME for example).