PowerShell oneliner to enable VM Network Optimization in VMM

Here’s how you can enable the VM Network Optimization on all network adapters on a VM:

Get-VM -Name VM01 -VMMServer localhost | Set-VirtualNetworkAdapter -VMNetworkOptimizationEnabled $True


And here’s how you can do the same for all VM’s:

Get-VM -VMMServer localhost | ForEach-Object { Set-VirtualNetworkAdapter -VMNetworkOptimizationEnabled $True }


And last is how you can enable them for all VM’s but only on those where it isn’t configured yet:

Get-VM -VMMServer localhost | Select-Object -ExpandProperty VirtualNetworkAdapters | where { $_.VMNetworkOptimizationEnabled -eq $False } | ForEach-Object { Set-VirtualNetworkAdapter -VMNetworkOptimizationEnabled $True }

 

Note: These commands use the VMM cmdlets!

Leave a Reply

Your email address will not be published. Required fields are marked *