Hi @GurudasSatardekar,
You can simple do this by using the PS commands.
Connect-AzureAD
Set-AzureADUser -ObjectId John.dave@Company portal .com -AccountEnabled $false
Revoke-AzureADUserAllRefreshToken -ObjectId John.dave@Company portal .com
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hello Team,
Please let me know process to remove login access and close all login sessions of terminated users via kb article for Office 365.
Exchange Online E3 license
Mailbox: John.dave@Company portal .com
Requirement: John is a terminated user and still tries to access the mailbox, azure ad and sharepoint sites. We need to close all ongoing sessions and block future logins.
Thank you in advance.
Hi @GurudasSatardekar,
You can simple do this by using the PS commands.
Connect-AzureAD
Set-AzureADUser -ObjectId John.dave@Company portal .com -AccountEnabled $false
Revoke-AzureADUserAllRefreshToken -ObjectId John.dave@Company portal .com
Hi @Gurudas
You could delete the user in Azure Active Directory:
You could also reset password, block sign-in or delete user in M365 admin center:
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
@GurudasSatardekar
Thank you for your post!
Adding onto what @Yi Lu_MSFT and @T. Kujala mentioned, when it comes to delete users within Azure Active Directory you can also revoke their sessions via the Portal.
When access is revoked:
The user can't gain new tokens for any application tied to Azure Active Directory. The elapsed time between revocation and the user losing their access depends on how the application is granting access:
For more info:
Disable user and Revoke tokens
Revoke a user's access Best practices
If you have any other questions, please let me know.
Thank you for your time and patience throughout this issue.
----------
Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.