0

I am trying to connect remote ESX host using PowerCli Version 6.5 release1 to get all VMs from Windows 10 system. while executing connect-VIServer I am not getting any output or errors. But while execute get-VMHost I get below error message. Vsphere client can connect to the ESX host using the same credentials . Please help fix powercli issue.

PS C:\> Connect-VIServer 10.44.6.45
PS C:\> Get-VMHost
Get-VMHost : 1/25/2019 6:51:43 PM       Get-VMHost              You are not currently connected to any servers. Please connect first
using a Connect cmdlet.
At line:1 char:1
+ Get-VMHost
+ ~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (:) [Get-VMHost], ViServerConnectionException
    + FullyQualifiedErrorId : Core_BaseCmdlet_NotConnectedError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVMHost

PS C:\>
user3369417
  • 358
  • 1
  • 4
  • 17

1 Answers1

0

Based no your code, I don't believe you're connected to the 10.44.6.45 host. I would expect to see a response with the connected host and the credentials being used to establish that connection whereas your code indicates no response at all.

You may want to attempt the following instead:

$creds = Get-Credential # Note: This will prompt you to enter your credentials
Connect-VIServer -Server 10.44.6.45 -Credential $creds
Kyle Ruddy
  • 1,886
  • 1
  • 7
  • 5