VMware Cloud Community
Darkwasp
Contributor
Contributor

Set-VMGuestNetworkInterface : The term 'Get-VMGuestNetworkInterface' is not recognized as the name of a cmdlet

Hello to All,

After installing the latest version of the PowerCIL tools I connected to my VIServer ran a few commands including get-vm. No problems. The issue is running this command "Set-VMGuestNetworkInterface". The command is not found. I need to use it to change IP addresses for may of the machines due to a migration. More documentation about the command can be found here. VMware vSphere 5.1

7 Replies
daphnissov
Immortal
Immortal

That cmdlet was long since deprecated and its announcement was covered in a blog post here. You will need to update your scripts accordingly.

0 Kudos
scott28tt
VMware Employee
VMware Employee

Moderator Note: Moved to PowerCLI


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
mgerber_uni
Contributor
Contributor

Hi.

That seems a bit rash.

Why would anyone take away a functionality where you can manage a VM that is powered off and replace it with a functionality where you have to have the VM powered on ?

It's like saying you need to run the VM to add a network interface to it.

I'm trying to build a small script to export MAC address information from powered off VM's in order to configure DHCP reservation.

The context is configuring new Citrix XenApp workers.

If anyone has an idea on how to do this now, I'm all ears.

Cheers.

Marcel

0 Kudos
LucD
Leadership
Leadership

Try like this

Get-VM | where{$_.PowerState -eq 'PoweredOff'} |

Get-NetworkAdapter |

Select @{N='VM';E={$_.Parent.Name}},Name,MacAddress |

Export-Csv -Path .\mac-report.csv -NoTypeInformation -UseCulture


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
mgerber_uni
Contributor
Contributor

Thanks.

I came up with this.

Get-VMGuest -VM $_ | % { $_.Nics } | select MacAddress -ExpandProperty MacAddress

0 Kudos
LucD
Leadership
Leadership

That will work if the VM is powered on, and for VMs that were recently powered off.
The reason is that your version is depending on the VMware Tools.
My version is getting the MAC from the vNIC, your version is getting the MAC fro inside the guest OS.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

mgerber_uni
Contributor
Contributor

Cool, thanks for the feedback !

0 Kudos