Hi all,
I'm trying to write powercli scripts to mass change VM IP addresses and hostnames. The hostnames I have no clue how to tackle, but I figured I could use Set-VMGuestNetworkInterface and Get-VMGuestNetworkinterface. I get this to work fine on the Windows XP machines in my environment, but it will not work on my Windows 7-32bit machines, or in my Windows 8 32/64 machines.
I've googled and read the help documents, and it looks like the cmdlet does not support those operating systems. I was wondering if anyone knows an alternative route or how I can make the cmdlet work. I read where someone edited the cmdlet .bat file to make it work, but they never gave details or responded to PMs.
Any help would be much appreciated.
Thank you!
Which version of PowerCLI are you using ?
Do a
Get-PowerCLIVersion
The latest build supports Win7 as per the release notes.
Are you running the script in the 32-bit version of PowerCLI ?
That is a requirement for those 2 cmdlets.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I am running the 32bit version of PowerCLI. Get-PowerCLIVersion reports
PowerCLI Version
-----------------------
VMware vSphere PowerCLI 5.1 Release 2 build 1012425
---------------------
Snapin Versions
----------------------
VMWare AutoDeploy PowerCLI Component 5.1 build 768137
VMWare ImageBuilder PowerCLI Component 5.1 build 768137
VMware vCloud Director PowerCLI Component 5.1 build 1012427
VMware License PowerCLI Component 5.1 build 669840
VMware VDS PowerCLI Component 5.1 build 1012428
VMware vSphere PowerCLI Component 5.1 build 1012428
That is the latest build.
You could consider using the Invoke-VMScript to launch a PowerShell script inside the guest OS.
And then use the Win32_NetworkAdapterConfiguration WMI class to configure the NIC(s).
Have a look here.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
