Workaround for TLS 1.0 / TLS 1.1 errors when running Microsoft Graph PowerShell

Target

For customers who wish to federate Microsoft 365 and HENNGE Access Control.

Purpose

This is the solution when encountering TLS 1.0/TLS 1.1 errors during Microsoft Graph PowerShell execution.

Cautions

The content of this article is based on product specifications as of April 2024 and is revised accordingly without advanced notice.

Procedures

Prerequisites

This is a workaround for the following error when running [ Connect-MgGraph ] in Microsoft Graph PowerShell.

__________2023-02-07_9.40.27.png

1. Check the current protocol version.

Execute the following command:

[Net.ServicePointManager]::SecurityProtocol

* If TLS 1.2 is not shown, proceed to the next step.

__________2023-01-27_18.31.56.png

2. Enforce the use of TLS 1.2.

Execute the following command:

* It may take up to 5 minutes to be applied.

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

This procedure should resolve the error.

3. Verify that TLS 1.2 is enforced.

Execute the following command

[Net.ServicePointManager]::SecurityProtocol

__________2023-02-07_9.41.21.png

4. (Optional) Depending on your environment, PowerShellGet may need to be updated.

Install PowerShellGet on Windows

* Because the default is an older version, you will need to execute the above command each time you use [Microsoft Graph PowerShell].
 

Reference

PowerShell Gallery TLS Support

          
Was this article helpful?