Hello Danish Anwar,
The article you referenced describes how to block sign-ins for shared mailbox accounts. This is a great first step to secure accounts that are not intended for direct user login.
additionally, you can do is apply the least privilege principle by ensuring that these accounts only have the minimum required permissions for the tasks they need to perform. If these accounts do not need any direct interaction with users, ensure they only have access to what’s absolutely necessary for the operation of Exchange and other related services.
You can block the sign-in of shared mailbox using CA policy in Entra ID. You can follow below instructions.
- Login to Entra ID portal https://entra.microsoft.com/
- Use Global admin credentials to login.
- Go to Protection >> Conditional access
- Click on Policies >> New policy
- Name the new policy
- Under user's section select users and groups and select the shared mailbox account.
- Under Target resources select "All cloud apps"
- Now go to Access controls >> Grant
- Under grant you can select Block access.
Create a CA policy to block sign-ins for service accounts or shared mailbox accounts by targeting these objects based on their attributes in Entra ID (e.g., checking if they are part of a particular group).
As for other CA policies:
-Block legacy authentication (e.g., for Exchange or other non-modern protocols) could further secure these identities.
-Enforce compliance policies (e.g., device compliance or security baselines) if these accounts are tied to devices or need to access resources outside of Exchange Online.
blocking sign-ins via CA policies for non-interactive accounts (such as shared mailboxes, service accounts, etc.) should not have any major impact, provided these accounts are truly not used for login purposes. However, it's important to test these policies in a controlled environment (using a small subset of accounts or a test group) to confirm they behave as expected.
Refer this below document which can help you to create a CA policy with more requirements:
how-to-limit-access-to-a-shared-mailbox-by-device
block-legacy-authentication
list-shared-mailboxes-with-signin-enabled-and-then-block-signin-using-powershell
I hope this clarifies things.
Please remember to "Accept Answer", so that others in the community facing similar issues can easily find the answers.