PowerCLI Add-VMHost: Unable to verify the authenticity of the specified host
Yep, I also started using PowerCLI more intensively. It’s really fun and makes repeating tasks easier to apply. As a Rookie in whatever you’re starting out with, there are obstacles that you might not be able to explain straight away. So let’s start with something small and I wanted to add an ESX host to my vCenter with the following command:
Write-Host -ForegroundColor YELLOW "!!! WARNING !!! You are adding an ESX Host to the vCenter."
Write-Host ""
Add-VMHost -Name powercli-esx3.irgnet.wtf -Location irgNET -User root -Password YourPassWord
But this failed because the host could not be authenticated because it uses self-signed SSL certificates with SHA1 thumbprint.
Now I also have to say that this is a Mac running ESX and I use it for my PowerCLI testing purposes, so I just want to ignore the certificate issue. As you can see from the error message, you get hints on how to bypass the certificate issue with the parameter “Force”, so let’s add the parameter right away:
Add-VMHost -Name powercli-esx3.irgnet.wtf -Location irgNET -User root -Password YourPassWord -Force
And there you go, the host can be added to the desired vCenter without any further effort.
Important! Never ignore certificate warnings in your production sites. Certificates with weak signature algorithms (SHA1) are no longer supported in vSphere 8.0!
That’s it for this little blog post, stay tuned for more PowerCLI posts and see you next time. 🙂