gpt4 book ai didi

powershell - 由于无视 PowerCLI 配置的无效证书,Connect-VIServer 无法连接

转载 作者:行者123 更新时间:2023-12-02 22:41:53 26 4
gpt4 key购买 nike

正如标题所暗示的,我正在尝试使用 PowerCLI 登录到 VMWare vSphere 服务器。即使我跑了 Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false -Scope AllUsers ,当我尝试连接到服务器时,这就是我得到的:

Connect-VIServer -Server "foobar.server" -User ... -Password ...
Connect-VIServer : 3/30/2020 4:16:46 PM Connect-VIServer Error: Invalid server certificate. Use Set-PowerCLIConfiguration to set the value for the InvalidCertificateAction option to Prompt if you'd like to connect once or to add a permanent exception for this server.
Additional Information: Could not establish secure channel for SSL/TLS with authority 'foobar.server'.
At line:1 char:1
+ Connect-VIServer -Server "foobar.server" -User ... -Passw ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [Connect-VIServer], ViSecurityNegotiationException
+ FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_CertificateError,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer

似乎配置需要:
Get-PowerCLIConfiguration

Scope ProxyPolicy DefaultVIServerMode InvalidCertificateAction DisplayDeprecationWarnings WebOperationTimeout
Seconds
----- ----------- ------------------- ------------------------ -------------------------- -------------------
Session UseSystemProxy Multiple Ignore True 300
User Ignore
AllUsers Ignore

为什么我无法连接到服务器?

最佳答案

如果您使用的是旧版本的 vCenter (5.5),请尝试以下操作:

[System.Net.ServicePointManager]::SecurityProtocol =[System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'

关于powershell - 由于无视 PowerCLI 配置的无效证书,Connect-VIServer 无法连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60931548/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com