I need to run some scripts to collect data from a large suite of VMs and I managed to use PowerCLI (via Powershell) and everything connected and worked fine. When I came back later to roll all the commands into a script so other people could run it I now get this error:
Connect-VIServer : 23/03/2020 14:29:22 Connect-VIServer An error occurred while making the HTTP request to https://<vcenter server>/sdk. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.
This happens whether I run the command in PowerShell or ISE and I just can't work out why - can anyone help?
There are 2 possible reasons (like the error message states)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Move to PowerCLI.
Moderator: This should either have been in the vCenter Server area or the PowerCLI area - I've moved it to the latter of the two.
Apologies for the terminology problems, I haven't used the system before today and I think that's what I've done. My Get-module output is below:
Can you tell me if I have the right details?
There are 2 possible reasons (like the error message states)
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I've added both of these in and I still get the same error. Interestingly enough I've just tried using the IP of the server instead (which never normally works for other operations) and that seems to be connecting and disconnecting fine. From that I would assume it's likely to be DNS due to remote working?
Could be, but it could also be that the certificate you are using on the vCenter only has the IP address.
And that it doesn't have the FQDN or hostname as Alternate Name.
Can you check what is in the certificate?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I've checked the certificate and it's got the FQDN of the server in it and not the IP. Odd - no worries though because the script I need to run can (and does) work via IP and it's only something simple.