This one will change the virtual network on all of your virtual machines. Very useful for when you change the name of a network or create a new one.
Get-VM | Get-NetworkAdapter | Set-NetworkAdapter -NetworkName "New Network"
Sorry, the comment form is closed at this time.
One hardly wants to move ALL vm’s to a new network, most of the time you’d want to move from one network to another so it would be something like this ?
Get-VM | Get-NetworkAdapter | where { $_.NetworkName -eq ‘Old Network’ } | Set-NetworkAdapter -NetworkName “New Network”
Generally speaking, yes.
Thanks for the addition.