Tuesday 31 October 2017

TLS 1.2, PowerShell and Dynamics CRM with VSTS Release Management

PowerShell often used in tasks in VSTS release management. When accessing services authenticated via AAD (Azure Active Directory) it might require to use TLS 1.2 protocol, if it is configured to be required in AAD setup. Setting up the machine as per instructions here to allow TLS 1.2 may not work with PowerShell. In case you are accessing Dynamics CRM online with PowerShell using Microsoft.Xrm.Data.PowerShell in VSTS release management you might see this issue as  “[error]Get-CrmConnection : The pipeline has been stopped.”


image

To get this fixed you need to add below line to the PowerShell script before executing Get-CrmConnection.

[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12

That would resolve the issue and connection to CRM will work from VSTS.image

1 comment:

Anonymous said...

Thank a lot. Your post helped me to connect to MS CRM online via powershell.

Popular Posts