Tag: Recycle Bin

  • How to Permanently Remove Soft-Deleted Microsoft 365 Users

    How to Permanently Remove Soft-Deleted Microsoft 365 Users

    When a Microsoft 365 user account is deleted, it is not immediately removed from the tenant. Instead, it is placed in the recycle bin as a soft-deleted object, allowing administrators to restore it if necessary.

    In some situations, such as cleanup operations, migrations, or testing environments, you may need to permanently remove these deleted accounts from Microsoft 365.

    This article shows how to list all soft-deleted users and permanently delete them using PowerShell.

    Connect to Microsoft 365

    Start an elevated PowerShell session and connect to Microsoft Online Services:

    Connect-MsolService

    You will be prompted to authenticate using an account with sufficient administrative permissions.

    List Soft-Deleted Users

    To display all users currently stored in the Microsoft 365 recycle bin, run:

    Get-MsolUser -All -ReturnDeletedUsers | Select DisplayName, UserPrincipalName, ObjectId | Format-Table

    Example output:

    DisplayName UserPrincipalName ObjectId
    2
    ----------- ----------------- --------
    3
    John Smith ExRemoved-dc6d160412444218fa06dbf4692079042@tenant.onmicrosoft.com

    Review the list carefully before proceeding with permanent removal.

    Permanently Delete a Soft-Deleted User

    To purge a deleted user from Microsoft 365 and remove it from the recycle bin permanently:

    Remove-MsolUser -UserPrincipalName "userprincipalname" -RemoveFromRecycleBin -Force

    Example:

    Remove-MsolUser -UserPrincipalName ExRemoved-dc6d160412444218fa06dbf4692079042@mydomain.onmicrosoft.com -RemoveFromRecycleBin

    PowerShell will ask for confirmation:

    Confirm
    2
    Continue with this operation?
    3
    [Y] Yes [N] No [S] Suspend [?] Help (default is "Y"):

    Press Y to continue.

    Verify the User Has Been Removed

    After the deletion completes, verify that the account no longer exists in the recycle bin:

    Get-MsolUser -UserPrincipalName ExRemoved-dc6d160412444218fa06dbf4692079042@mydomain.onmicrosoft.com -ReturnDeletedUsers

    If the command returns no results, the user has been successfully and permanently removed.

    Important Notes

    • Permanent deletion cannot be undone.
    • Any remaining Azure AD object associated with the deleted account will be removed.
    • Always verify that the account is no longer required before purging it.
    • Consider exporting a list of soft-deleted users before performing bulk cleanup operations.

    Conclusion

    Soft-deleted Microsoft 365 users remain recoverable until they are permanently removed from the recycle bin. Using the MSOnline PowerShell module, administrators can quickly identify deleted users, permanently purge them, and verify the cleanup operation.

    This process is particularly useful during tenant maintenance, migration projects, and housekeeping activities where obsolete accounts must be fully removed.