Recently while working with Vmware PowerCLI on one of my new laptop, when connecting to esxi server and vCenter server with Connect-VIserver command, I was receiving below error.
Connect-VIServer $esxiserver -User $user -Password $password
Connect-VIServer The SSL connection could not be established, see inner exception.
This error is occuring due to vCenter or Esxi isn't configured with valid certificate and has self-signed certificate. To ignore the non-trusted certification error run below command to i.
Set-PowerCLIConfiguration -InvalidCertificateAction:Ignore
Perform operation?
Performing operation 'Update VMware.PowerCLI configuration.'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
Scope ProxyPolicy DefaultVIServerMode InvalidCertificateAction DisplayDeprecationWarnings WebOperationTimeout
Seconds
----- ---------- ------------------- ------------------------ -------------------------- --------------------
Session UseSystemProxy Multiple Ignore Trye 300
User
AllUsers
After the SSL certificate configuration in PowerCLI is connected to server successfully.
Useful Articles
How to import default vCenter server appliance VMCA root certificate and refresh CA certificate on ESXi
How to replace default vCenter VMCA certificate with Microsoft CA signed certificate
Managing ESXi SSL certificate properties from vCenter server
Forward vCenter Server Appliance logs to syslog server
VMware vCenter Server 7 Profiles with PowerShell
Configure vCenter 7 Profile from PowerShell GUI