Sign-in should be blocked for the accounts behind shared mailboxes
This check looks at the user accounts that sit behind shared mailboxes in Microsoft 365 and whether direct sign-in is disabled. The safe setting is that nobody can log in as the shared mailbox itself; people open it through their own accounts instead.
Why it matters
Every shared mailbox has a user account in the directory, even though it is not meant to be signed into. If that account is enabled and someone sets or resets a password for it, it becomes a shared login with no individual accountability and, in many cases, no multi-factor prompt. Attackers like such accounts because they are rarely reviewed.
Microsoft's documentation on shared mailboxes explains that people reach them through delegated permissions on their own accounts, and that the sign-in for the mailbox account should be blocked. See the pages under sources.
How to check it yourself
In the Microsoft 365 admin center, open Teams & groups, then Shared mailboxes, select a mailbox and look at the option to block sign-in. You can also open Users in the Microsoft Entra admin center and look at whether the account is enabled.
For many mailboxes at once, this read-only PowerShell lists every shared mailbox and whether its account is enabled (it needs the Exchange Online and Microsoft Graph modules and read permissions):
Connect-ExchangeOnline
Connect-MgGraph -Scopes 'User.Read.All'
Get-EXOMailbox -RecipientTypeDetails SharedMailbox -ResultSize Unlimited |
ForEach-Object { Get-MgUser -UserId $_.ExternalDirectoryObjectId -Property DisplayName,AccountEnabled } |
Select-Object DisplayName,AccountEnabledAny row with AccountEnabled set to True is a shared mailbox that can be signed into.
How to fix it
In the Microsoft 365 admin center, open the shared mailbox, choose the option to block sign-in and save. To do it in bulk, use PowerShell with the Graph module and the permission to update users, after you have reviewed the list from the check above:
Connect-MgGraph -Scopes 'User.ReadWrite.All'
Update-MgUser -UserId '<shared-mailbox-object-id>' -AccountEnabled:$falseTry the change on one mailbox first. ConfigCobra only reports this setting and never changes your tenant; an administrator applies the fix.
What changes when you fix it
People who have Full Access or Send As rights on the shared mailbox are not affected. They continue to open it from Outlook or the web using their own accounts.
What stops working is any use of the shared mailbox's own credentials: someone signing in directly with its address and a password, or an old script, scanner or application that authenticates as the shared mailbox. Find those before you block sign-in, for example by reviewing recent sign-in logs for the account, and move them to a delegated or application-based method.
Included in
| Benchmark | CIS ID | Profile |
|---|---|---|
| CIS Microsoft 365 Foundations v7.0.0 | 1.2.2 | E3 Level 1 |
More checks in Microsoft 365 admin center
- Microsoft 365 groups should not be publicly visibleCIS 1.2.1
- Administrative accounts should be cloud-only, not synced from on-premisesCIS 1.1.1
- Two emergency access accounts have been definedCIS 1.1.2
- The number of Global Administrators should be between two and fourCIS 1.1.3
- Administrative accounts should use a license with a reduced application footprintCIS 1.1.4
Go further
- Microsoft 365 admin center15 controls in this section
- CIS Microsoft 365 Foundations v7.0.0160 controls
- CIS Microsoft 365 Foundations checklistEvery control in one list, as CSV
- RemediationSee what a fix changes in your tenant before you apply it, then use the generated script
- Monitoring & DriftDaily scans, drift detection and email alerts when a control regresses
Check this on your Microsoft 365
ConfigCobra runs this check with every other control of the CIS Microsoft 365 Foundations Benchmark, read-only.