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.
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
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
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
You are right the a should be 0-3, did not think of that.
"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.