PowerCLI: Connect-VIServer Certificate Errors

KB ID 0001603

Problem

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

 

[box]

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

[/box]

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;

[box]

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

[/box]

Try again.

Related Articles, References, Credits, or External Links

NA

Leave a Reply

Your email address will not be published. Required fields are marked *