繁体   English   中英

Connect-NsxServer:响应状态代码不表示成功:403(禁止)

[英]Connect-NsxServer: Response status code does not indicate success: 403 (Forbidden)

在安装了 PowerShell 的 Ubuntu 18 上运行以下命令

PS /data/git> Connect-NsxServer -Server $NSXServer -Protocol https -User $User -Password $Password -IgnoreInvalidCertificate:$true -V

我正进入(状态

Connect-NsxServer: Response status code does not indicate success: 403 (Forbidden).

我之前也尝试过以下方法:

PS /data/git> Connect-NsxServer -Server 10.241.4.197 -Protocol https -User administrator@vsphere.local -Password SepU^BN54QEsk^3 -V

VERBOSE: 'IgnoreInvalidCertificate' not specified. Trying to retrieve and use VMware.Powercli 'InvalidCertificateAction' setting.

VERBOSE: InvalidCertificateAction: Ignore

以前它在我使用 Ubuntu 16 时工作,根据他们的站点,PowerShell 不再支持它。
https://learn.microsoft.com/en-us/powershell/scripting/install/install-ubuntu?view=powershell-7.3

我期待连接 NSXServer 但未连接。

在运行Connect-NsxServer之前使用Set-PowerCLIConfiguration并将其-InvalidCertificateAction参数设置为Ignore并省略其-IgnoreInvalidCertificate参数。

电源外壳

$pass = Read-Host "Enter Nsx Server password" -AsSecureString;
$bstr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pass)
$pass = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($bstr)

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false;
Connect-NsxServer -Server 10.241.4.197 -Protocol https -User administrator@vsphere.local -Password $pass;

配套资源

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM