Thursday , April 25 2024
Home - Don't Forget! - The pain of TLS 1.2 with PowerShell module for Azure Active Directory (MSOnline)

The pain of TLS 1.2 with PowerShell module for Azure Active Directory (MSOnline)

Building labs in a hurry sometimes can bite you with recent changes in Office 365 connections.  I just got hit with a problem with PowerShell module for Azure Active Directory not connecting:

The problem relates to the connection type from a very unpatched (on purpose) Windows 2016 lab server for developing a Powershell script against Azure AD.  While working out the authentication errors I noticed a TLS issue.  At this point of time there has been a major change by Microsoft from TLS 1.1 to 1.2 which stopped the Auth Process to connect using command Connect-msolservice.

Running the following command fix this issue:

This force .net 4.x or higher to use TLS 1.2 for connections. Powershell Connections to Azure AD now restored.

I hope this help others!


Check Also

How to use DNS Pin Point instead Split Horizon – the easy way!

Background on the DNS issue faced There are times when DNS split horizon is required …


  1. I ran into this problem and am so glad you wrote up a nice and easy guide to fixing it. It tested perfectly without a restart to resolve my connectivity issues! Thanks!

  2. I was having the exact same issue. I was throwing the error when I ran my script from the Powershell ISE. I used this workaround and it did the trick…thanks!

  3. Thanks a lot. This is awesome to solve a problem I have been ignoring 🙂

  4. I was having this issue with a central Powershell reporting server I had established. Thank you for finding this out!

  5. 1000X Thanks 🙂

  6. Very thanks :))

  7. Hi, this works like a charm!, I had to restart the server but it worked!, thank you so much!

Leave a Reply

Your email address will not be published. Required fields are marked *