VMware Cloud Community
mikelleen
Contributor
Contributor
Jump to solution

Set-NetworkAdapter fails with "The Mac Address is invalid..."

Pretty simple command:

$TargetNetworkMacAddress = '00:50:56:a1:00:00'

Get-NetworkAdapter -VM $TargetVMName | where {$_.Name -eq $TargetNetworkAdapterName} | Set-NetworkAdapter -MacAddress  $TargetNetworkMacAddress -confirm:$false

Produces error:

Set-NetworkAdapter : 7/19/2012 4:27:54 PM    Set-NetworkAdapter        The MAC address is invalid or is not in the valid range 00:50:56:00:00:00 - 00:50:56:3F:FF:FF.   
At line:1 char:39
+ $MyNetworkAdapter | Set-NetworkAdapter <<<<  -MacAddress '00:50:56:a1:00:00'
    + CategoryInfo          : InvalidArgument: (:) [Set-NetworkAdapter], InvalidArgument
    + FullyQualifiedErrorId : Common_SharedParameterHelper_TryValidateStaticMacAddress_InvalidM
   acAddress,VMware.VimAutomation.ViCore.Cmdlets.Commands.VirtualDevice.SetNetworkAdapter

PowerCLI Version
----------------
   VMware vSphere PowerCLI 5.0 build 435427
---------------
Snapin Versions
---------------
   VMWare AutoDeploy PowerCLI 5.0 build 575
   VMWare ImageBuilder PowerCLI 5.0 build 575
   VMware License PowerCLI 5.0 build 395016
   VMWare vSphere PowerCLI 5.0 build 435427

Any ideas on why I am getting this error? The Mac address seems to be in the appropriate range.

0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership
Jump to solution

The specified MAC address 00:50:56:a1:00:00 is not in the valid range 00:50:56:00:00:00 - 00:50:56:3F:FF:FF. In the specified MAC address the 'a' should be 0 to 3.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

0 Kudos
4 Replies
Grzesiekk
Expert
Expert
Jump to solution

Hello,

  have you tried this ?

http://vnugglets.com/2011/07/setting-mac-address-for-vm-nics-using.html

http://communities.vmware.com/message/1247046

Let us know if that helped.

Regards,

Greg

--- @blog https://grzegorzkulikowski.info
RvdNieuwendijk
Leadership
Leadership
Jump to solution

The specified MAC address 00:50:56:a1:00:00 is not in the valid range 00:50:56:00:00:00 - 00:50:56:3F:FF:FF. In the specified MAC address the 'a' should be 0 to 3.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
mikelleen
Contributor
Contributor
Jump to solution

You are right the a should be 0-3, did not think of that.

0 Kudos
mikelleen
Contributor
Contributor
Jump to solution

"Hello,

have you tried this ?

http://vnugglets.com/2011/07/setting-mac-address-for-vm-nics-using.html

http://communities.vmware.com/message/1247046

Let us know if that helped.

Regards,

Greg"

Actually this looks to be the better answer and I am testing it now.

Thanks, I'll let you know if this creates any issues.

0 Kudos