MT.1185 - Block legacy MSOnline (MSOL) PowerShell module
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:β
- Connect to Graph using Connect-MgGraph -Scopes "Policy.ReadWrite.Authorization".
- Run the following PowerShell command to review the current value:
Get-MgPolicyAuthorizationPolicy | Select-Object BlockMsolPowerShell
- If
BlockMsolPowerShellis$false, block the legacy MSOnline PowerShell module:
# This example uses the cmdlet syntax published in the Microsoft Learn documentation:
# https://learn.microsoft.com/en-us/powershell/module/microsoft.graph.identity.signins/update-mgpolicyauthorizationpolicy
$params = @{
blockMsolPowerShell = $true
}
Update-MgPolicyAuthorizationPolicy -BodyParameter $params
Related linksβ
- Authorization policy in Entra ID | Microsoft Learn
- Update-MgPolicyAuthorizationPolicy | Microsoft Learn - Graph PowerShell v1.0
Test Metadataβ
| Field | Value |
|---|---|
| Test ID | MT.1185 |
| Severity | High |
| Suite | Maester |
| Category | Entra |
| PowerShell test | Test-MtEntraMsolPowerShellBlocked |
| Tags | Entra, Maester, MT.1185 |
Sourceβ
- Pester test:
tests/Maester/Entra/Test-MtEntraMsolPowerShellBlocked.Tests.ps1 - PowerShell source:
powershell/public/maester/entra/Test-MtEntraMsolPowerShellBlocked.ps1