Quick Tip – PowerCLI Invalid server certificate

When trying to connect with PowerCLI to a vCenter Server Appliance the following error occurred:

Connect-vIServer : 18-7-2018 13:20:10 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.

As stated in the error, the Set-PowerCLIConfiguration command can be used to ignore the certificate check using the following syntax:

Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false

After this command you’re able to connect to the vCenter without the certificate error.

2 thoughts on “Quick Tip – PowerCLI Invalid server certificate”

  1. The solution does work if you connect to vCenter server once per PowerShell session. If you connect to the same vCenter again, it will fail with the same error message. So all scripts that use multiple connections to the same vCenter don’t work anymore and I have to open a new PowerShell session for every script I want to run. Worked fine with PowerCLI 6.5R1. The issue came with PowerCLI 10 and persists with version 11. I probably need to open a SR.

  2. Can you please help me how to no prompt form below powercli command

    Set-PowerCLIConfiguration -ProxyPolicy NoProxy:$false

    its asking Y A N C options .. I want to make it default Y

Leave a Comment