[How To]: Change Linux IP Address via PowerCLI
There is some reason that you want to change IP address on virtual machines as an example, moving virtual machines to a new VLAN or port-group or moving them to another site or replicate virtual machine to an offsite recovery site.
Changing IP on machines one by one is very difficult on more than one machine and it be tougher.
PowerCLI has cmdlet that it called “Invoke-VMScript”, the cmdlet lets you to run scripts on guest OS even when guest OS has no IP. But VMware Tools must be installed and also updated VMware Tools is recommended.
Also you must have guest OS credential to run your script.
Here is a sample script to change IP address on multiple VM and also change NFS mount point IP addresses on “fstab” file.
Before run, you must customize the below script and put proper network configuration file within the script: