VMware Cloud Community
Harpstein123
Enthusiast
Enthusiast
Jump to solution

Assign new port group to guests

Hi all,

I am trying to use a work around for non-persistent pools, because of one application's dependence on static IPs. Is there a way to re-assign a port group to a guest VM?

Thank you in advance!!

Tim

Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Try thisd

Get-VM <vm-name> | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName <new-portgroupname> -Confirm:$false

If you have more than 1 NIC connected to the guest you can use a where clause to select the correct NIC

Get-VM <vm-name> | Get-NetworkAdapter | where{$_.Name -eq "Network adapter 2"} | `
   Set-NetworkAdapter -NetworkName <new-portgroupname> -Confirm:$false

____________

Blog: LucD notes

Twitter: lucd22


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

View solution in original post

Reply
0 Kudos
3 Replies
LucD
Leadership
Leadership
Jump to solution

Try thisd

Get-VM <vm-name> | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName <new-portgroupname> -Confirm:$false

If you have more than 1 NIC connected to the guest you can use a where clause to select the correct NIC

Get-VM <vm-name> | Get-NetworkAdapter | where{$_.Name -eq "Network adapter 2"} | `
   Set-NetworkAdapter -NetworkName <new-portgroupname> -Confirm:$false

____________

Blog: LucD notes

Twitter: lucd22


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

Reply
0 Kudos
Harpstein123
Enthusiast
Enthusiast
Jump to solution

Is that using PowerCLI?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

Yes, those are PowerCLI cmdlets.

____________

Blog: LucD notes

Twitter: lucd22


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

Reply
0 Kudos