<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: PowerCLI to reset network settings like done in DCUI in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-to-reset-network-settings-like-done-in-DCUI/m-p/1393845#M45331</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Afaik there is no API or command that performs that DCUI functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can reset your network configuration through the &lt;A href="https://www.vmware.com/support/developer/PowerCLI/PowerCLI651/html/Get-EsxCli.html"&gt;Get-EsxCli &lt;/A&gt;cmdlet, but the problem there would be that you are cutting off the branch on which you are sitting.&lt;/P&gt;&lt;P&gt;See for example a set of esxcli commands in &lt;A href="http://defaultreasoning.com/2012/12/21/esxcli-basics-troubleshooting-management-network-connection-on-esxi-5-x/"&gt;ESXCLI Basics: Troubleshooting Management Network Connection on ESXi 5.x&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a side note, isn't a restart of the ESXi node picking up the MAC change?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Jul 2017 05:10:10 GMT</pubDate>
    <dc:creator>LucD</dc:creator>
    <dc:date>2017-07-12T05:10:10Z</dc:date>
    <item>
      <title>PowerCLI to reset network settings like done in DCUI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-to-reset-network-settings-like-done-in-DCUI/m-p/1393844#M45330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am going through our entire environment making a change where the mac address of the management nic changes.&amp;nbsp; Long story short, on each host I am having to manually login to the console and do a network restore.&amp;nbsp; I'd like to try to program this as you can login through powershell to a host directly.&amp;nbsp; I happened upon a page &lt;A href="http://searchvmware.techtarget.com/tip/PowersHell-Factory-Reset-of-ESXi" title="http://searchvmware.techtarget.com/tip/PowersHell-Factory-Reset-of-ESXi"&gt;http://searchvmware.techtarget.com/tip/PowersHell-Factory-Reset-of-ESXi&lt;/A&gt;&amp;nbsp; which shows doing a complete factory reset through powershell.&amp;nbsp; I just want to restore the network settings to default. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code in the webpage is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$vmhost = "esx4.vi4book.com"&lt;/P&gt;&lt;P&gt;$vcname = "virtualcenter4.vi4book.com"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#Connect to vCenter &amp;amp; Enter Maintenance Mode&lt;/P&gt;&lt;P&gt;Connect-VIServer $vcname -username administrator -password vmware&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$esxhost = Get-VMHost $vmhost&lt;/P&gt;&lt;P&gt;$hostview = $esxhost | Get-View&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set-VMHost $esxhost -State maintenance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Remove ESX host from vCenter...&lt;/P&gt;&lt;P&gt;Remove-VMHost $vmhost -Confirm:$false&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;# Carry out factory reset...&lt;/P&gt;&lt;P&gt;Connect-VIServer $vmhost -username root -password password&lt;/P&gt;&lt;P&gt;$esxhost = Get-VMHost $vmhost&lt;/P&gt;&lt;P&gt;$hostview = $esxhost | Get-View&lt;/P&gt;&lt;P&gt;$ns = Get-View -Id $hostview.ConfigManager.firmwareSystem&lt;/P&gt;&lt;P&gt;$ns.ResetFirmwareToFactoryDefaults()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've looked around a bit in the API but haven't found anything yet. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jul 2017 21:43:01 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-to-reset-network-settings-like-done-in-DCUI/m-p/1393844#M45330</guid>
      <dc:creator>flynmooney</dc:creator>
      <dc:date>2017-07-11T21:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI to reset network settings like done in DCUI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-to-reset-network-settings-like-done-in-DCUI/m-p/1393845#M45331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Afaik there is no API or command that performs that DCUI functionality.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can reset your network configuration through the &lt;A href="https://www.vmware.com/support/developer/PowerCLI/PowerCLI651/html/Get-EsxCli.html"&gt;Get-EsxCli &lt;/A&gt;cmdlet, but the problem there would be that you are cutting off the branch on which you are sitting.&lt;/P&gt;&lt;P&gt;See for example a set of esxcli commands in &lt;A href="http://defaultreasoning.com/2012/12/21/esxcli-basics-troubleshooting-management-network-connection-on-esxi-5-x/"&gt;ESXCLI Basics: Troubleshooting Management Network Connection on ESXi 5.x&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On a side note, isn't a restart of the ESXi node picking up the MAC change?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 05:10:10 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-to-reset-network-settings-like-done-in-DCUI/m-p/1393845#M45331</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2017-07-12T05:10:10Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI to reset network settings like done in DCUI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-to-reset-network-settings-like-done-in-DCUI/m-p/1393846#M45332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Here's the MAC before the machine reconfiguration.&amp;nbsp; We're doing DHCP reservations and while the machine is being reconfigured and firmware being updated I go and change the dhcp reservation. It seems though that vmk0 is holding onto the MAC address even after the boot.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;The host profile which was previously applied has a setting of "Prompt the user for the MAC address if no default is available" for the management interface.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; C:\Users\xxxx&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; C:\Users\xxxx&amp;gt; $esxhost = get-vmhost xxxxxxxxxx&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; C:\Users\xxxx&amp;gt; $mgmt = $esxhost | Get-VMHostNetworkAdapter | ? { $_.Name -eq "vmk0" }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; C:\Users\xxxx&amp;gt; $mgmt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mac&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DhcpEnabled IP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubnetMask&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DeviceName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------- --&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;vmk0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xx:xx:xx:xx:00:5a True&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxx.xxx.xxx.141&amp;nbsp;&amp;nbsp; 255.255.255.0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vmk0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Machine Reconfig done within UCS (Firmware update and vnic changes)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;C:\Users\xxxx&amp;gt; $mgmt = $vmhost | Get-VMHostNetworkAdapter | ? { $_.Name -eq "vmk0" }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;C:\Users\xxxx&amp;gt; $mgmt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mac&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DhcpEnabled IP&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SubnetMask&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DeviceName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;---&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ---&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------- --&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----------&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;vmk0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xx:xx:xx:xx:00:5a True&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxx.xxx.xxx.24&amp;nbsp;&amp;nbsp;&amp;nbsp; 255.255.255.0&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vmk0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt; C:\Users\xxxx&amp;gt; Get-UcsServiceProfile xxxxxxxxxx| Get-UcsVnic | select name,addr&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Addr&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;----&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ----&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;esx-vmnic0-mgmt&amp;nbsp; xx:xx:xx:xx:00:4B&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 14:28:32 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-to-reset-network-settings-like-done-in-DCUI/m-p/1393846#M45332</guid>
      <dc:creator>flynmooney</dc:creator>
      <dc:date>2017-07-12T14:28:32Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI to reset network settings like done in DCUI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-to-reset-network-settings-like-done-in-DCUI/m-p/1393847#M45333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see.&lt;/P&gt;&lt;P&gt;Does the &lt;A href="https://vdc-repo.vmware.com/vmwb-repository/dcr-public/6b586ed2-655c-49d9-9029-bc416323cb22/fa0b429a-a695-4c11-b7d2-2cbc284049dc/doc/vim.host.NetworkSystem.html#refresh"&gt;RefreshNetworkSystem &lt;/A&gt;method change that MAC?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 15:57:14 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-to-reset-network-settings-like-done-in-DCUI/m-p/1393847#M45333</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2017-07-12T15:57:14Z</dc:date>
    </item>
    <item>
      <title>Re: PowerCLI to reset network settings like done in DCUI</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-to-reset-network-settings-like-done-in-DCUI/m-p/1393848#M45334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.&amp;nbsp; Code snip below.&amp;nbsp; Thanks for the help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variables needed:&lt;/P&gt;&lt;P&gt;$ipaddress&lt;/P&gt;&lt;P&gt;$esxcred&lt;/P&gt;&lt;P&gt;$mac&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Connect-VIServer $ipaddress -credential $esxcred&lt;/P&gt;&lt;P&gt;$esxhost = Get-VMHost&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$hostview = $esxhost | Get-View&lt;/P&gt;&lt;P&gt;$net = Get-View -Id $hostview.configmanager.networksystem&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$vnic = $net.networkinfo.vnic | ? { $_.device -eq "vmk0" }&lt;BR /&gt;$spec = $vnic.spec&lt;/P&gt;&lt;P&gt;$spec.mac = $mac&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$net.UpdateVirtualNic("vmk0",$spec)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;disconnect-viserver * -confirm:$false&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Jul 2017 20:14:02 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/PowerCLI-to-reset-network-settings-like-done-in-DCUI/m-p/1393848#M45334</guid>
      <dc:creator>flynmooney</dc:creator>
      <dc:date>2017-07-12T20:14:02Z</dc:date>
    </item>
  </channel>
</rss>

