Change Vlan ID of Virtual Machines with Powershell

You can change vlan id of virtual machines with Powershell:

1
2
3
4
5
Add-PSSnapin -name Microsoft.SystemCenter.VirtualMachineManager
Get-Vmmserver localhost
$VMNO = $args[0]
$VLANID = $args [1]
get-vm $VMNO | Get-VirtualNetworkAdapter | Set-VirtualNetworkAdapter -VLANEnabled $true -VLANID $VLANID

If you need to disable Vlan, just use $false for -VLANEnabled.

Tags: , , , , ,


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply