Share via

Invoke-AzVMCommand in Cloud Shell error error:1416F086:SSL

Patrick Brangan 21 Reputation points
2021-01-16T12:50:51.09+00:00

Hi,

I'm working in Cloud Shell and I'm trying to use the Invoke-AzVMCommand to view services running on a test VM.

I've done the following:

Enable-AzVMPSRemoting -Name web02 -ResourceGroupName PB-RG-Training01 -Protocol https -OsType Windows

$u = 'test'
$p = ConvertTo-SecureString '********' -AsPlainText -Force
$cred = New-Object System.Management.Automation.PSCredential ($u, $p)

I then run this command:

Invoke-AzVMCommand -Name web02 -ResourceGroupName PB-RG-Training01 -ScriptBlock {get-service win*} -Credential $cred

And this is the response I get:

OpenError: /usr/local/share/powershell/Modules/PSCloudShellUtility/PSCloudShellUtility.psm1:1112
Line |
1112 | Invoke-Command @invokeCommandParams -ErrorAction Stop
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| [13.79.4.200] Connecting to remote server 13.79.4.200 failed
| with the following error message : error:1416F086:SSL
| routines:tls_process_server_certificate:certificate verify
| failed For more information, see the
| about_Remote_Troubleshooting Help topic.

I've checked the NSG and I can see the winrm rule in there. I can RDP to the server etc. I turned off the Windows firewall but this made no difference.

Any help would be really appreciated.

Thanks,

Paddy

Windows for business | Windows Server | User experience | Other

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.