• Home
  • Posts
  • How to Recover Deleted Emails Using Microsoft Office 365 PowerShell
How to Recover Deleted Emails Using Microsoft Office 365 PowerShell
recover deleted emails powershell

“I’ve deleted an important email and need to get it back. Help!” As a Microsoft Office 365 admin, you’ve probably faced this situation often. You’ll start by looking in the usual places – the Deleted Items folder and then the Recoverable Items folder. However, 28 days have passed and the email is permanently deleted. PowerShell to the rescue! Microsoft Office 365 PowerShell is a powerful tool to recover deleted emails, particularly permanently deleted ones that cannot be retrieved from the Deleted Items folder or the Recoverable Items folder. Read on for step-by-step instructions and a video walkthrough to recover deleted emails using M365 (Microsoft Office 365) PowerShell.

Still within the 28-day timeframe? Check out our Ultimate Admin’s Guide to Recover Deleted Emails in Outlook with videos and instructions to recover deleted emails in Outlook using the Deleted Items folder, Recoverable Items folder, and by eDiscovery.

Video: How to Recover Deleted Emails Using M365 PowerShell

Microsoft Office 365 PowerShell Commands to Recover Deleted Emails

When an email is deleted, it first goes to the Deleted Items folder for 14 days and then to the Recoverable Items folder for another 14 days. After these 28 days have passed since the initial deletion, then only you, as the administrator, can restore these items using PowerShell. The administrator needs to run these PowerShell commands to restore deleted items from the “Recoverable Items”. Note that this is only valid within 14 days.

Step 1: Open Microsoft Office 365 PowerShell

recover deleted emails m365 powershell

Step 2: Connect to Exchange Online using cmdlet and enter your credentials

connect-ExchangeOnline
recover deleted emails m365 powershell

Step 3: Run the PowerShell Query

Run the cmdlet below whereby all deleted emails which contain “excited” in the subject line from the slava@demoppm4.onmicrosoft.com mailbox will be recovered to “One2 New Employee” user’s mailbox to the “MySearch” folder

recover deleted emails m365 powershell