<?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: VMware PowerCLI script Error. Urgent help needed! in VMware PowerCLI Discussions</title>
    <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VMware-PowerCLI-script-Error-Urgent-help-needed/m-p/2743808#M96306</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect you might be connected to multiple vCenters.&lt;/P&gt;&lt;P&gt;Check what is in $global:defaultviservers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can limit your Get-VMHost to a specific vCenter by adding the Server parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="text-align: Left; font-family: Segoe UI; font-style: normal; font-weight: normal; font-size: 12; color: #000000;"&gt;&lt;P style="font-family: Lucida Console; margin: 0 0 0 0; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 16;"&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;SPAN&gt;Get-VMHost&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;&lt;SPAN&gt;-Server&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;&lt;SPAN&gt;$vcenter&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Lucida Console; margin: 0 0 0 0; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Mar 2017 07:09:25 GMT</pubDate>
    <dc:creator>LucD</dc:creator>
    <dc:date>2017-03-02T07:09:25Z</dc:date>
    <item>
      <title>VMware PowerCLI script Error. Urgent help needed!</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VMware-PowerCLI-script-Error-Urgent-help-needed/m-p/2743807#M96305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello VSphere Powercli Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can some one please tell me why ESX hosts from vcenter1 is appearing on all 4 vcenters in the output? Thanks a lot in advance!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$Username = Read-Host -Prompt "Please enter your Username:"&lt;/P&gt;&lt;P&gt;$Password = Read-Host -Prompt "Please enter your Password:"&lt;/P&gt;&lt;P&gt;$vcenters = @("vcenter1","&lt;SPAN style="font-size: 13.3333px;"&gt;vcenter2&lt;/SPAN&gt;","&lt;SPAN style="font-size: 13.3333px;"&gt;vcenter3&lt;/SPAN&gt;","&lt;SPAN style="font-size: 13.3333px;"&gt;vcenter4&lt;/SPAN&gt;")&lt;/P&gt;&lt;P&gt;$HostReport = @()&lt;/P&gt;&lt;P&gt;ForEach ($vcenter in $vcenters)&lt;/P&gt;&lt;P&gt;{ &lt;/P&gt;&lt;P&gt;Connect-VIServer $vcenter -User $Username -Password $Password&lt;/P&gt;&lt;P&gt;Get-VMHost |Get-View |%{ &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $HReport = "" | select vCenter, Hostname, ESX_Version&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $HReport.vCenter = $vcenter&lt;/P&gt;&lt;P&gt;&amp;nbsp; $HReport.Hostname = $_.Name&lt;/P&gt;&lt;P&gt;&amp;nbsp; $HReport.ESX_Version = $_.config.product.version&lt;/P&gt;&lt;P&gt;&amp;nbsp; $HostReport += $HReport&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Disconnect-VIServer $vcenter -Confirm:$false&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;$HostReport | Export-Csv "C:\ESXHostReport.csv" -NoTypeInformation&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Mar 2017 07:00:06 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VMware-PowerCLI-script-Error-Urgent-help-needed/m-p/2743807#M96305</guid>
      <dc:creator>VJ_VMware_111</dc:creator>
      <dc:date>2017-03-02T07:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: VMware PowerCLI script Error. Urgent help needed!</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VMware-PowerCLI-script-Error-Urgent-help-needed/m-p/2743808#M96306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suspect you might be connected to multiple vCenters.&lt;/P&gt;&lt;P&gt;Check what is in $global:defaultviservers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can limit your Get-VMHost to a specific vCenter by adding the Server parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="text-align: Left; font-family: Segoe UI; font-style: normal; font-weight: normal; font-size: 12; color: #000000;"&gt;&lt;P style="font-family: Lucida Console; margin: 0 0 0 0; background-color: #ffffff;"&gt;&lt;SPAN style="font-size: 16;"&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;SPAN&gt;Get-VMHost&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000080;"&gt;&lt;SPAN&gt;-Server&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #ff4500;"&gt;&lt;SPAN&gt;$vcenter&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: Lucida Console; margin: 0 0 0 0; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Mar 2017 07:09:25 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VMware-PowerCLI-script-Error-Urgent-help-needed/m-p/2743808#M96306</guid>
      <dc:creator>LucD</dc:creator>
      <dc:date>2017-03-02T07:09:25Z</dc:date>
    </item>
    <item>
      <title>Re: VMware PowerCLI script Error. Urgent help needed!</title>
      <link>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VMware-PowerCLI-script-Error-Urgent-help-needed/m-p/2743809#M96307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can see vcenter1 when i run &lt;SPAN style="color: #666666; font-family: proxima-nova, Arial, sans-serif; font-size: 14px;"&gt;$global:defaultviservers&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;I added &lt;SPAN style="font-size: 14px; font-family: 'Lucida Console';"&gt;Server&lt;/SPAN&gt;&lt;SPAN style="font-size: 14px; font-family: 'Lucida Console';"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #575757; font-size: 14px; font-family: 'Lucida Console';"&gt;parameter for Get-VMHost, and it fixed the issue. Thanks a lot! &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Mar 2017 07:18:46 GMT</pubDate>
      <guid>https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/VMware-PowerCLI-script-Error-Urgent-help-needed/m-p/2743809#M96307</guid>
      <dc:creator>VJ_VMware_111</dc:creator>
      <dc:date>2017-03-02T07:18:46Z</dc:date>
    </item>
  </channel>
</rss>

