【问题标题】:VMware powercli connection error to single esxi homelabVMware powercli 连接到单个 esxi homelab 时出错
【发布时间】:2020-12-16 16:43:36
【问题描述】:

环境

由单个 VMware ESXi 主机组成的家庭 VMware 实验室。

  • 客户端版本:1.33.4
  • 客户端内部版本号:14093553
  • ESXi 版本:6.7.0
  • ESXi 内部版本号:14320388

运行脚本的电脑

  • Windows 10
  • Powershell 5.1
  • VMware PowerCLI 12.0.0 内部版本 15947286
  • 连接的用户附加了 vmware 管理员角色。

代码

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

错误

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 : {}

我尝试过的

留下凭据并让它询问,给出相同的错误

故意输入错误的密码 - 给出错误的密码信息

从用户中删除管理员角色 - 给出未经授权的消息

最后两个测试的输出让我相信我实际上验证正常,但是我没有设置或启用一些设置/服务,允许它在验证后连接。

任何建议将不胜感激。

【问题讨论】:

  • 您有评估许可证吗? IIRC 免费许可证不授予 API 访问权限。

标签: powershell vmware


【解决方案1】:

分配了免费许可证的 ESXi 主机不授予使用 API 服务的访问权限,这是 PowerCLI 在幕后所做的。

错误消息确认您无权访问 API 服务。

【讨论】:

  • 啊,谢谢,在接近我们的实际系统之前在家进行测试。
【解决方案2】:

只是添加一个辅助答案,以防其他人偶然发现它。 起初我以为是因为我正在连接到我的家庭评估版。 但是,在连接到我们的公司环境时,我遇到了完全相同的问题。

事实证明,我在机器上的帐户被锁定为 PowerShell 受限语言模式。在没有设置模式的帐户上运行命令允许它们运行正常。

【讨论】:

    猜你喜欢
    • 2022-11-12
    • 2019-10-01
    • 2011-05-03
    • 2023-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多