How to block or unblock user sign-ins in Microsoft 365?
+
Microsoft 365 admins often need to block or unblock user sign-ins in various scenarios. Here are a few common reasons for disabling a user account:
- Blocking sign-ins after multiple failed attempts from unfamiliar locations can protect user data from being compromised.
- When an employee leaves the organization permanently or temporarily, blocking their sign-in prevents them from accessing company resources.
Follow the steps below to block or unblock users from signing in to Microsoft 365.
- Click on the user you want to block or unblock from the Active users page.
- To block a user, click on the Block sign-in option, and enable the Block this user from signing in check box.
- Click the Save changes button.
Similarly, to unblock the user, uncheck the Block this user from signing in check box, and click the Save changes button.
Note: After blocking or unblocking a user, it may take up to 15 minutes for the changes to take effect.
To block or unblock user sign-ins in Microsoft 365, first connect to the MS Graph PowerShell with the user read-write permissions.
Connect-MgGraph -Scopes User.ReadWrite.All
Run the ‘Update-MgUser’ cmdlet with the parameter ‘AccountEnabled’ set to false to block Office 365 user sign-ins.
Update-MgUser -UserId <User_Id> -AccountEnabled:$false
Similarly, to unblock the user from sign-in, use the same cmdlet with the parameter ‘AccountEnabled’ set to true.
Update-MgUser -UserId <User_Id> -AccountEnabled:$true
Track repeated login attempts from disabled users with just a few clicks using AdminDroid.
- AdminDroid's Disabled Users' Login Attempts report allows you to identify the sign-in attempts made by blocked users.
- Here, you can review blocked users' sign-ins with details, such as sign-in time, signed-in user, IP address, sign-in status, etc.
Handy Hint: Utilize the Schedule option available with the reports to receive regular insights via email in formats such as CSV, PDF, XLS, and more.