- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The "RefreshNetworkSystem" call did not fix the mac but it led me to going through the network members again and I found "UpdateVirtualNic" which worked like a charm. Code snip below. Thanks for the help.
Variables needed:
$ipaddress
$esxcred
$mac
Connect-VIServer $ipaddress -credential $esxcred
$esxhost = Get-VMHost
$hostview = $esxhost | Get-View
$net = Get-View -Id $hostview.configmanager.networksystem
$vnic = $net.networkinfo.vnic | ? { $_.device -eq "vmk0" }
$spec = $vnic.spec
$spec.mac = $mac
$net.UpdateVirtualNic("vmk0",$spec)
disconnect-viserver * -confirm:$false