powershell - VMware powercli 连接到单个 esxi homelab 时出错
问题描述
环境
由单个 VMware ESXi 主机组成的家庭 VMware 实验室。
- 客户端版本:1.33.4
- 客户端内部版本号:14093553
- ESXi 版本:6.7.0
- ESXi 内部版本号:14320388
运行脚本的 PC
- 视窗 10
- 电源外壳 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 : {}
我试过的
留下凭证并让它询问,给出同样的错误
故意输入错误的密码 - 给出错误的密码信息
从用户中删除管理员角色 - 给出未经授权的消息
最后两个测试的输出让我相信我实际上验证正常,但是有一些我没有设置或启用的设置/服务允许它在验证后连接。
任何建议,将不胜感激。
解决方案
分配了免费许可证的 ESXi 主机不授予使用 API 服务的访问权限,这是 PowerCLI 在幕后所做的。
错误消息确认您无权访问 API 服务。
推荐阅读
- javascript - 带有ajax的联系表格。如何写入“mail.php”的路径(我使用 gulp)
- swift - NavigationLink 显示为灰色且不执行任何操作
- unity3d - 编辑器 unity3d 未连接到服务
- android - 本机库中的 OpenCV 创建错误
- perl - .vim 文件夹中有存储文本过滤器的好地方吗?
- sql - 执行计划索引使用
- sql-server - 使用 SQLCMD 在 Microsoft SQL Server 上执行大型脚本文件 (1.7GB)
- javascript - Javascript更改url参数不生效
- javascript - Highcharts,构建“文本”图
- numpy - 如何将布尔值更改为数组中的字符串