0
votes

Environment

Home VMware lab consisting of a single VMware ESXi host.

  • Client version: 1.33.4
  • Client build number: 14093553
  • ESXi version: 6.7.0
  • ESXi build number: 14320388

PC running the script

  • Windows 10
  • Powershell 5.1
  • VMware PowerCLI 12.0.0 build 15947286
  • user connecting has the vmware administrator role attached to it.

Code

clear-host
$vc = 'my-hhost-ip'
$user='myuser'
$pw='mypassword'
Set-PowerCLIConfiguration -InvalidCertificateAction:ignore 
Connect-VIServer -server $vc -Protocol https -user $user -password $pw

Error

Connect-VIServer : Specified method is not supported.
At line:6 char:1
+ Connect-VIServer -server $vc -Protocol https -user $user -password $p ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (:) [Connect-VIServer], PSNotSupportedException
    + FullyQualifiedErrorId : NotSupported,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer

PSMessageDetails      : 
Exception             : System.Management.Automation.PSNotSupportedException: Specified method is not supported.
TargetObject          : 
CategoryInfo          : NotImplemented: (:) [Connect-VIServer], PSNotSupportedException
FullyQualifiedErrorId : NotSupported,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer
ErrorDetails          : 
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 16
PipelineIterationInfo : {}

What I've tried

leaving of the credentials and having it ask, gives the same error

Deliberately getting the password wrong - gives an incorrect password message

Removing the administrator role from the user - gives a not authorised message

The output of the last two tests leads me to believe I am in fact authenticating ok, but that there is then some setting/service I've not set or enabled that allows it to connect after authenticating.

Any suggestions would be appreciated.

2
Do you have an evaluation license? IIRC the free license doesn’t give API access.Doug Maurer

2 Answers

1
votes

ESXi hosts assigned the free license don't grant access to consume the API services, which is what PowerCLI is doing under the covers.

The error message is confirming that you do not have the ability to access the API services.

1
votes

Just to add a secondary answer in case anybody else stumbles upon it. I thought at first that it was because I was connecting to my home eval edition. However, I got the exact same issue when connecting to our corporate environment.

It turns out that my account on the machine was locked down to PowerShell constrained language mode. Running the commands on an account that did not have the mode set allowed them to run ok.