23
Mai
Résoudre les erreurs de certificat SSL invalide lors de la connexion PowerShell
Si vous souhaitez vous connecter en PowerShell à votre vCenter et que vous n’utilisez pas un certificat signé par une autorité de certification, il y a de grandes chances que vous receviez de la console PowerShell un joli message d’erreur …..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
. PS C:\Users\moncompteadmin> connect-viserver -name MonVCenterDeProd <span style="color: #993300;"><span style="color: #993300;" data-mce-style="color: #993300;">AVERTISSEMENT : Please consider joining the VMware Customer Experience Improvement Program, so you can help us make PowerCLI a better product. You can join using the following command: Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true VMware's Customer Experience Improvement Program ("CEIP") provides VMware with information that enables VMware to improve its products and services, to fix problems, and to advise you on how best to deploy and use our products. As part of the CEIP, VMware collects technical information about your organization’s use of VMware products and services on a regular basis in association with your organization’s VMware license key( s). This information does not personally identify any individual. For more details: type "help about_ceip" to see the related help article. To disable this warning and set your preference use the following command and restart PowerShell: Set-PowerCLIConfiguration -Scope User -ParticipateInCEIP $true or $false.</span></span> <span style="color: #ff0000;"><span style="color: #ff0000;" data-mce-style="color: #ff0000;">connect-viserver : 23/05/2018 16:41:29 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: Impossible d'établir une relation de confiance pour le canal sécurisé SSL/TLS avec l'autorité 'MonVCenterDeProd'. Au caractère Ligne:1 : 1 + connect-viserver vcenter + ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : Erreur de sécurité : (:) [Connect-VIServer], ViSecurityNegotiationException + FullyQualifiedErrorId : Client20_ConnectivityServiceImpl_Reconnect_CertificateError,VMware.VimAutomation.ViCore.Cmdlets.Commands.ConnectVIServer</span></span> . |
Il faut donc modifier la configuration PowerCli et ignorer les Certificats invalide.. et pour cela vous faites un Set-PowerCLIConfiguration
1 2 3 4 5 6 7 8 9 10 11 12 |
. Set-PowerCLIConfiguration -InvalidCertificateAction ignore -confirm:$false Scope ProxyPolicy DefaultVIServerMode InvalidCertificateAction DisplayDeprecationWarnings WebOperationTimeout Seconds ----- ----------- ------------------- ------------------------ -------------------------- ------------------- Session UseSystemProxy Multiple Ignore True 300 User Multiple Ignore AllUsers Multiple Ignore . |