1 Day Left – The Most Awesome PowerShell One-Liner in the History of PowerShell One-Liners!

by bunchc on December 18, 2008

get-datacenter MyVC | get-vm | Get-NetworkAdapter | Where-Object { $_.Name -like "*1"} | Set-NetworkAdapter -NetworkName NotThatNetwork -Confirm:$false

So, say you provision all of your VM’s on one host, with one set of networks, that is completely removed from the remainder of your infrastructure. You then Cold-Migrate the new VM’s to their new homes. You now need to chance the network names to match. What you say? You have a dozen, a hundred of them to change? The above PowerShell one-liner will take care of all of that for you.

Questions? Comments? Leave em in the comments.

{ 1 trackback }

Changing vNIC Port Group Assignment in VMware with PowerShell « H9Newser’s Blog
January 5, 2009 at 4:10 pm

Comments on this entry are closed.

blog comments powered by Disqus

Previous post:

Next post: