
Many users inquire about the process of swiftly deleting Office 365 users from the recycle bin using PowerShell, particularly during an Exchange migration facilitated by the Priasoft Migration Suite for Exchange. When a user is deleted from Office 365, they are moved into a recycle bin, allowing for potential restoration within a predefined timeframe, typically 30 days.
(Please Note: Once an object has been deleted from the recycle bin, restoration is impossible, and the action is permanent. Exercise caution when utilizing this method.)
▼ Please scroll down to see the Powershell Command ▼
FEATURED PRIASOFT
OFFICE 365 MIGRATION TOOLS
Public Folder Reporting
Public Folder Reporting & Analysis for Office 365
Gain control and deep insights into your Exchange / Office 365 Public Folders with comprehensive reporting, analysis, and remediation
Public Folder Data Migration
Seamless Office 365 Public Folder Migration Tool
Eliminate the need for unreliable third-party tools. Our solution guarantees seamless mail-enabled public folder migration, content transfer, and precise Public Folder permission migration.
Outlook Profile Migration
Outlook Profile Updater for Smooth Migrations
Ensure smooth transitions during migrations with our Outlook Profile Update Manager. Don’t let AutoDiscover issues ruin your experience—update profiles correctly from the start.
PST and Mailbox Export
Efficient PST & Office 365 Exchange Administration
Manage PSTs effortlessly with our DevOps-friendly solution. From ingestion to data export for legal discovery, and efficient Office 365 mailbox management, all powered by PowerShell.
To see a list of deleted users currently in the recycle bin you can use the following Powershell command:
Get-MsolUser -ReturnDeletedUsers
You should see an output similar to that shown below:
| UserPrincipalName | DisplayName | isLicensed |
| —————– | —————– | —————– |
| DemoUser5@microsoft.com | Demo User 5 | True |
| DemoUser2@microsoft.com | Demo User 2 | True |
| DemoUser4@microsoft.com | Demo User 4 | True |
If you wish to remove a single item from the recycle bin use can use the Powershell command:
Remove-MsolUser -UserPrincipalName 'UserUPN@Domain.com' -RemoveFromRecycleBin
Subsequently, if you would like to remove all the users in the recycle bin you can use the following Powershell command:
Get-MsolUser -ReturnDeletedUsers | Remove-MsolUser -RemoveFromRecycleBin -Force
(If you would like to be prompted for each delete, you can remove the -Force switch from the command above.)
(Please Note: Once an object has been deleted from the recycle bin, restoration is impossible, and the action is permanent. Exercise caution when utilizing this method.)
Ready to Talk Through Your Migration?
Priasoft has been handling Exchange and Microsoft 365 migrations since 1999. Whether you're scoping a new project or recovering from a stalled one, our engineers have seen it before. No sales pitch — just a working conversation with people who have done this work at scale.




