7 Replies Latest reply on Jan 21, 2020 4:23 AM by Sebastiancl

    Using the Set-NetworkAdapter PowerShell function - not able when machine is PoweredOn or PoweredOff.

    Sebastiancl Lurker

      I'm having an issue with the vmware.powercli PowerShell module version: 11.5.0.14912921

       

      I'm trying to set the MAC address and Network of a network adapter attached to a VM.

      But i'm unable to do so, due to the machine being PoweredOn or PoweredOff.

       

       

      Stop-VM 'Machine' |  Get-NetworkAdapter | Set-NetworkAdapter -MacAddress '<MAC Address>' -Connected $true -StartConnected $true -Confirm:$false

      Start-VM 'Machine' | Get-NetworkAdapter | Set-NetworkAdapter -MacAddress '<MAC Address>' -Connected $true -StartConnected $true -Confirm:$false

      Suspend-VM 'Machine' |  Get-NetworkAdapter | Set-NetworkAdapter -MacAddress '<MAC Address>' -Connected $true -StartConnected $true -Confirm:$false

       

      The only way I'm getting it to work is to Power off the machine, remove NetworkAdapter and create a new one.

       

      Get-VM 'Machine' | Get-NetworkAdapter | Remove-NetworkAdapter -Confirm:$false | New-NetworkAdapter -MacAddress <MAC Address> -NetworkName $VMNetwork -StartConnected -Type e1000e

       

      Error messages attached.

       

      Anyone else having this issue?