![](/img/trans.png)
[英]Getting an error with Connect-NsxServer with powershell PowerNSX module
[英]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;
无效证书操作:
Ignore
- 该 cmdlet 将在不考虑证书无效的情况下建立连接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.