<?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: Replacing VMHostID with Host's Name in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Replacing-VMHostID-with-Host-s-Name/m-p/2142447#M69653</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Tee-Object cmdlet is your friend in these cases :smileycool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Get-VMHost&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;ForEach-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-Process&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; {
&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Tee-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-InputObject&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;$_&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-Variable&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Temp&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Get-VirtualPortGroup&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; 
&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Select&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"VMHost"&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Temp&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;}}&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;VirtualSwitch&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;VirtualSwitchName&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;VLanId&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;}
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 May 2012 18:51:34 GMT</pubDate>
    <dc:creator>LucD</dc:creator>
    <dc:date>2012-05-11T18:51:34Z</dc:date>
    <item>
      <title>Replacing VMHostID with Host's Name</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Replacing-VMHostID-with-Host-s-Name/m-p/2142446#M69652</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm running the following command:&lt;/P&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Get-VMHost | Get-VirtualPortGroup | Select VMHostId,Name,VirtualSwitch,VirtualSwitchName,VLanId | Export-Csv "PathHere"&lt;/BLOCKQUOTE&gt;&lt;P&gt;Which returns all of the information I want, except it puts the VMHostId instead of the actual host's name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="597"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl24" height="17" width="157"&gt;VMHostId&lt;/TD&gt;&lt;TD class="xl24" width="192"&gt;Name&lt;/TD&gt;&lt;TD class="xl24" width="83"&gt;VirtualSwitch&lt;/TD&gt;&lt;TD class="xl24" width="118"&gt;VirtualSwitchName&lt;/TD&gt;&lt;TD class="xl24" width="47"&gt;VLanId&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl24" height="17"&gt;HostSystem-host-97975&lt;/TD&gt;&lt;TD class="xl24"&gt;Service Console&lt;/TD&gt;&lt;TD class="xl24"&gt;vSwitch0&lt;/TD&gt;&lt;TD class="xl24"&gt;vSwitch0&lt;/TD&gt;&lt;TD align="right" class="xl24"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see Parent or any other similar options under the Select from within the Get-VirtualPortGroup. What is the proper way to get the Host's actual name instead of the VMHostId? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 17:56:19 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Replacing-VMHostID-with-Host-s-Name/m-p/2142446#M69652</guid>
      <dc:creator>eeg3</dc:creator>
      <dc:date>2012-05-11T17:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing VMHostID with Host's Name</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Replacing-VMHostID-with-Host-s-Name/m-p/2142447#M69653</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The Tee-Object cmdlet is your friend in these cases :smileycool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Get-VMHost&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;ForEach-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-Process&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; {
&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Tee-Object&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-InputObject&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;$_&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;-Variable&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Temp&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #5F9EA0;"&gt;Get-VirtualPortGroup&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;|&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; 
&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Select&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;@&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;N&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #800000;"&gt;"VMHost"&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;;E&lt;/SPAN&gt;&lt;SPAN style="color: #FF0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Temp&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;}}&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;Name&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;VirtualSwitch&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;VirtualSwitchName&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;,&lt;/SPAN&gt;&lt;SPAN style="color: #0000FF;"&gt;VLanId&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;}
&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 18:51:34 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Replacing-VMHostID-with-Host-s-Name/m-p/2142447#M69653</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2012-05-11T18:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing VMHostID with Host's Name</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Replacing-VMHostID-with-Host-s-Name/m-p/2142448#M69654</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That works perfectly; thanks, sir!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 May 2012 19:33:08 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Replacing-VMHostID-with-Host-s-Name/m-p/2142448#M69654</guid>
      <dc:creator>eeg3</dc:creator>
      <dc:date>2012-05-11T19:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing VMHostID with Host's Name</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Replacing-VMHostID-with-Host-s-Name/m-p/2142449#M69655</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hallo LucD,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thx also for your solution. It helps me a lot.&lt;/P&gt;&lt;P&gt;But for me it is not working 100% properly because in the first loop the &lt;SPAN style="color: #0000ff;"&gt;E&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Temp&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;Name} &lt;SPAN style="color: #000000;"&gt;stays empty. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;In the 2nd loop the &lt;SPAN style="color: #0000ff;"&gt;E&lt;/SPAN&gt;&lt;SPAN style="color: #ff0000;"&gt;=&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;{&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;$Temp&lt;/SPAN&gt;&lt;SPAN style="color: #000000;"&gt;.&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;Name} &lt;SPAN style="color: #000000;"&gt;has the name of the first VM from Loop 1 and so on.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;Maybee you have an Idea ?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000;"&gt;I am using Powershell Version 2 on an Windows Server 2008 R2&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Aug 2015 07:44:18 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/Replacing-VMHostID-with-Host-s-Name/m-p/2142449#M69655</guid>
      <dc:creator>FrancoNero1</dc:creator>
      <dc:date>2015-08-25T07:44:18Z</dc:date>
    </item>
  </channel>
</rss>

