# Block legacy MSOnline (MSOL) PowerShell module

Checks if the legacy MSOnline (MSOL) PowerShell module is blocked from authenticating to the tenant.

Source: https://maester.dev/docs/tests/MT.1185

<!-- This file is generated by website/scripts/generate-test-docs.mjs. Do not edit manually. -->

<div class="test-byline"><div class="test-byline-avatars"><a class="test-byline-avatar test-byline-avatar--author" href="/contributors/bakkerjan" title="Jan Bakker · Original author"><img src="https://github.com/BakkerJan.png" alt="Jan Bakker" width="28" height="28" loading="lazy" decoding="async" /></a></div><div class="test-byline-meta"><span class="test-byline-text">Contributed by <a href="/contributors/bakkerjan">Jan Bakker</a></span><a class="test-byline-link" href="/contributors">All contributors →</a></div></div>

<p class="test-part">Part of <a href="/docs/tests/maester">Maester</a> · Entra ID · User and directory settings · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId MT.1185
```

## Overview

## Description

Checks if the legacy MSOnline (MSOL) PowerShell module is blocked from authenticating to the tenant.

## Why This Matters

The MSOnline (MSOL) and Azure AD PowerShell modules were retired by Microsoft and no longer receive security updates. Because they predate modern authentication controls, requests made through them can be a weaker, less-monitored path into a tenant's identity administration than the current Microsoft Graph PowerShell SDK.

The `blockMsolPowerShell` setting on the tenant's authorization policy lets an admin explicitly block authentication requests from the legacy MSOnline PowerShell module's service principal. This isn't enabled by default for every tenant, so it needs to be checked explicitly rather than assumed to already be in place — leaving it unblocked keeps an unsupported and unmonitored administrative access path open.

### Remediation action

1. Connect to Graph using **Connect-MgGraph -Scopes "Policy.ReadWrite.Authorization"**.
2. Run the following PowerShell command to review the current value:

```powershell
Get-MgPolicyAuthorizationPolicy | Select-Object BlockMsolPowerShell
```

3. If `BlockMsolPowerShell` is `$false`, block the legacy MSOnline PowerShell module:

```powershell
# This example uses the cmdlet syntax published in the Microsoft Learn documentation:
# https://learn.microsoft.com/powershell/module/microsoft.graph.identity.signins/update-mgpolicyauthorizationpolicy
$params = @{
    blockMsolPowerShell = $true
}
Update-MgPolicyAuthorizationPolicy -BodyParameter $params
```

### Related links

* [Authorization policy in Entra ID | Microsoft Learn](https://learn.microsoft.com/graph/api/resources/authorizationpolicy)
* [Update-MgPolicyAuthorizationPolicy | Microsoft Learn - Graph PowerShell v1.0](https://learn.microsoft.com/powershell/module/microsoft.graph.identity.signins/update-mgpolicyauthorizationpolicy)

## Details

<details>
<summary>Every attribute of this check</summary>

| Field | Value |
| --- | --- |
| Test ID | MT.1185 |
| Severity | Medium |
| Suite | Maester |
| Product | Entra ID |
| Feature | User and directory settings |
| Area | Access control |
| Resource type | Tenant |
| User impact | Low |
| Implementation cost | Low |
| MITRE ATT&CK | T1059.009 Cloud API, T1078.004 Cloud Accounts |
| Supports controls | nist-800-53-r5:CM-7 |
| PowerShell test | [Test-MtEntraMsolPowerShellBlocked](https://github.com/maester365/maester/blob/main/tests/maester/entra/Test.MT.1185.ps1) |
| Services | Graph |

</details>

## Source

- Test: [`tests/maester/entra/Test.MT.1185.ps1`](https://github.com/maester365/maester/blob/main/tests/maester/entra/Test.MT.1185.ps1)
- Documentation: [`tests/maester/entra/Test.MT.1185.md`](https://github.com/maester365/maester/blob/main/tests/maester/entra/Test.MT.1185.md)
