PowerCLI: Connect-VIServer Certificate Errors

When attempting to connect to a vCenter or ESXi host, you see the following error;
Connect-VIServer certificate error 

Connect-VIServer : {Date} {Time} 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 trust relationship for the SSL/TLS secure channel with authority
'{Server-Name}'. 
At line:1 char:1 
+ Connect-VIServer 
+ ~~~~~~~~~~~~~~~~ 
    + CategoryInfo : SecurityError: (:) [Connect-VIServer], ViSecurityNegotiationException 
    + FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_CertificateError,
VMware.VimAutomation.ViCore.
 Cmdlets.Commands.ConnectVIServer

Solution
Well you can either ‘Sort out your certificates properly, or ‘Drag down the self signed certificate and install it‘, or simply execute the following command;

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

PowerCLI Certificate Errors
Try again.

Post a Comment

0 Comments