Moving VM's from One Switch to Another

Moving VM's from One Switch to Another

I found this example in the VMworld Europe presentation (excellent by the way) that would allow you to move a Virtual Machine from one virtual switch to another.

get-vm vm1 | set-networkadapter "Production"

Now say you wanted to move all vm's from the "VM Network" to "Production"

get-vm | where { ($_ | get-networkadapter).NetworkName -eq"VM Network} | set-networkadapter -networkname "Production"

This would move all VM's from the VM Network to Production.


It seems like this is moving from one portgroup to another on the same switch.  I'm trying to move from one switch to another.  To make matters worse, I'm trying to script a list of vm's to move from a 1000v to a standard vswitch0.  They both have the exact same portgroup names (no downtime switchover.. this is a migrastion).

ANy thoughts on how to do this in powershell?

Version history
Revision #:
1 of 1
Last update:
‎05-14-2008 03:20 PM
Updated by: