Audit Email Deletion in Office 365: Find Out Who Deleted an Email from a Mailbox  (2024)

Most admins wonder how to find out whodeletedan emailfromamailbox? If you are one of them, this blog is for you.

How to Determine If a User Deleted Email Items:

Usersdeletetheemails either by accident oronpurpose.As an admin, you can usetheaudit log toidentifydeleted emails in Office 365.Microsoft has turned on mailbox audit logging by default forcertain actionsfrom Jan 2019. If your tenant has created before2019 or you want to audit all the mailbox actions, you mustenable mailbox auditingthrough PowerShell.

To track the deleted email, youneed to filter out the audit log for the following actions, which are audited by default:

MoveToDeletedItems– Moved emails to deleted items.

SoftDelete–Deleted message fromdeleted items folder

HardDelete– Purgedmessages from RecoverableItems folder

How to Find Out Who Deleted Email fromaMailbox?

You can use either Audit logsearch (UI) or PowerShell to see who deleted an email in Outlook.

Audit log search:In the audit log search, you can filter outthe above-mentioned‘message delete events’to track the deleted emails.Also, you can download the audit log search results to a CSV file. However, you can’t view the required data like email subject,folder,and result status at aglance. Those attributes are formatted asaJSON object, which needs to be parsed for further information.

PowerShell:You can useSearch-UnifiedAuditLogSearchcmdlet toauditemail deletion.But, retrieving audit logsusing PowerShell has more challenges. For example, if you don’t retrieve the audit logs properly, you will end up with data lossandsession time outerror.So, youare required tospend more timeoptimizingthe PowerShell code.

To ease your work, we have created a PowerShell script to investigate email deletion issues more efficiently.

Download Script: AuditDeletedEmails.ps1

Script Highlights:
  • The script usesmodern authenticationto retrieve audit logs.
  • The script can be executed withMFA enabled accounttoo.
  • Exports report results toCSVfile.
  • Allows you totrack all the deleted emails.
  • Helps to find out who deleted email fromashared mailbox.
  • Allows you to generate an email deletion audit report for acustom period.
  • Automaticallyinstalls the EXO V2 module(if not installed already) upon your confirmation.
  • The script isscheduler-friendly. I.e., Credential can be passed as a parameter instead of saving inside the script.
Audit Email Deletion Report – Sample Output:

The exported report contains Email Deletion Time, Type of Deletion, Target Mailbox, Deleted By, No. of Emails Deleted, Email Subjects, Folder, Result Status and other Audit Info.

Audit Email Deletion in Office365:Find Out Who Deleted an EmailfromaMailbox (1)

Audit Deleted Emails in Office 365 – Script Execution

To run the script, you can choose any one of the below methods.

Method 1: Execute script with MFA and non-MFA account

PowerShell

1

.\AuditDeletedEmails.ps1

Method 2: Execute script by explicitly mentioning credential (Scheduler friendly).

PowerShell

1

.\AuditDeletedEmails.ps1 -UserName admin@contoso.com -Password XXX

If the admin account has MFA, then you need to disable MFA based on the Conditional Access policy to make it work.

More use-cases of ‘Audit Deleted Emails’ PowerShell script:

Thescript supports the following in-builtparams to schedule and generate more granular report.

  1. Mailbox–>Getsdeleted emails fromaspecific mailbox
  2. Subject–> Identifies deleted emails by subject.
  3. StartDateandEndDate–>Generatesaudit report foracustom period
  4. UserName andPassword–>Schedulesthe PowerShell script without interactive login.

By using above-mentioned params,I haveformedfew use-cases of this script below,

  • Track all the deleted emails – Who deleted what message and when
  • How to find out who deleted emails fromashared mailbox
  • Audit deleted emails fromaspecific mailbox
  • Find deleted emails by their subject
  • Auditemail deletion for custom period
  • Schedule ‘Deleted email audit report’
  • Get a monthly report on deleted emails

Track All the Deleted Emails – Who Deleted What Message and When:

Users might delete ormovecritical business emails to deleted items unknowingly. So, admins need to identify the Exchange emails that were deleted or moved to deleted items in theirorganization.

By default, the script will track all the deleted emails in the last 90 days.

PowerShell

1

.\AuditDeletedEmails.ps1

The exported audit report provides a clear view of who deleted the email, from which mailbox, what message, and when. By referring to this report, admins can recover the deleted emails based on the requirement.

How to Find out Who Deleted Emails from Shared mailbox:

Since the shared mailboxes can be accessed by multiple users(I.e.,shared mailbox delegates), it’s necessary to identify the user whohasdeletedan email fromashared mailbox.To view who have permission on shared mailboxes, you can refer our blog post onget shared mailboxdelegates.

Totrack whodeleted emailsfromashared mailbox, run the script with –Mailbox param.

PowerShell

1

.\AuditDeletedEmails.ps1 -Mailbox Marketing@contoso.com

The exported report shows the deleted emails in‘Marketing@contoso.com’mailbox for the past 90 days.

AuditWhoDeleted Emails from aSpecificMailbox:

An organization may have requirements to allowsome usersto accessanother user’s mailbox.So, the emails can be deleted bymailboxdelegatesand owners.You can generateamailbox permission reportto know the mailbox delegates.

Toaudit email deletion inaspecificmailbox, run the script with –Mailbox param.

PowerShell

1

.\AuditDeletedEmails.ps1 -Mailbox John@contoso.com

The above example retrieves the deleted emails from the John’s mailbox forthe last 90 days.

FindDeleted Emails by Subject:

If you want to find an important emailfrom thepool ofdeleted emails, you can filter out the emails by subject (a word or phrase thatthe subject contains).

To identify deleted emails by subject, run the script with –Subject param as follows,

PowerShell

1

.\AuditDeletedEmails.ps1 -Subject “Status”

It will list all the deleted emails, which have ‘status’ in their subject.

Audit Email Deletion for a Custom Period:

By default, thescript will generatetheaudit report forthepast 90 days. If you want to generateanemail audit report for a specific time range, you can run the script with –StartDate and –EndDateparams.

PowerShell

1

.\AuditDeletedEmails.ps1 -StartDate 7/25/21 -EndDate 8/01/21

The above formatgetsallthe emailsdeletedbetweenJuly 25, 2021,andAug 01, 2021.

PowerShell

1

.\AuditDeletedEmails.ps1 -StartDate 7/15/21 -EndDate 7/30/21 -Mailbox John@contoso.com

This example retrievesall thedeleted emailsfrom John’s mailbox between July 15, 2021,and July 30, 2021.

Schedule ‘Deleted Emails Audit Report’:

Since the ‘Search-UnifiedAuditLog‘ can keepanaudit log for 90 days, you may require old data for analysis.

In that case, scheduling will help you to keep the audit log foralonger period.To run this script asPowerShell scheduled task, you can use the below format in the Windows Task Scheduler.

PowerShell

1

.\AuditDeletedEmails.ps1 -UserName admin@contoso.com -Password XXX

Note: You might have read our earlier blog post on “Office 365 keeps audit log for 365 days for all the subscriptions”. But we haven’t retrieved 365 days of audit data in this script. We will update our script once Microsoft announces it officially.

Get a Monthly Report on Email Deletion:

To get a monthly report on deleted emails, run the script as follows,

PowerShell

1

.\AuditDeletedEmails.ps1 -StartDate ((Get-Date).AddDays(-30)) -EndDate (Get-Date) -UserName admin@contoso.com -Password XXX

You can also use the above format to get scheduled monthly report.

Audit Email Deletion in a More Effective Way:

By using PowerShell filters and conditions, admins can customize the script based on their needs. But, It requires a lot of time and PowerShell knowledge. WithAdminDroid Office 365 auditing tool, you can get the reports in a few mouse clicks. Also, you can slice and dice the data by using contextual filters and graphs.

For example,

  • When was the mail deleted? – You can select a specific date or week or a custom period.
  • Who deleted emails? – You can filter out emails that are deleted by a specific user or list of users.
  • What operation was performed? – You can identify deleted emails based on the deletion methods such as soft delete, hard delete, move to deleted items folder, etc.
  • View deleted emails from a specific mailbox – You can find out who deleted an email from a specific mailbox.

The report providesAI-powered graphical analysisto gain insights and better understand the data in a visually appealing manner.

Audit Email Deletion in Office365:Find Out Who Deleted an EmailfromaMailbox (2)

AdminDroid provides1500+pre-built reports and 20 smart visually appealing dashboards to know about your Office 365 environment at a glance. This tool provides reports on Office 365 reporting, auditing, analytics, usage statistics, security & compliance, etc.

Additionally, AdminDroid offers100+ reports and dashboards completely for free. It includes reports on Users, Licenses, Groups, Group Members, Devices, Login Activities, Password Changes, License Changes, and more. The free edition doesn’t have any restrictions in reporting functionalities such as customization, scheduling, and exporting. DownloadFree Office365 reporting tool by AdminDroidand see how it helps for you.

I hope this blog will you toidentify who deleted an emailfrom a mailbox. Ifyoufind any user’s activity suspicious, you canmonitorthe user’s activityto protect your organization from maliciousintent.


You may also like these blogs:

  • AuditFile Deletionin SharePoint Online: Find Out Who Deleted Files…
  • Audit Send As Emails in Microsoft 365: Find Out Who Sent Email from…
  • Find Who Sent Email from Shared Mailbox in Office 365 using PowerShell
  • Find AllInbox Rules that Forwards Emails Externally in Office 365 using…
  • Enable Standalone Editing Using 'Check Out' in SharePoint Online
  • Knock Out Phishing Attacks Using TokenProtectioninConditionalAccess

  • Audit Email Deletion in Office 365: Find Out Who Deleted an Email from a Mailbox  (2024)

    FAQs

    Can you find out who deleted an email from a shared mailbox? ›

    Find Out Who Deleted an Email from a Shared Exchange Mailbox

    To search mailbox audit logs, the Search-MailboxAuditLog cmdlet is used. The cmdlet is available both in on-prem Exchange Server and in cloud Exchange Online (some options may differ).

    How do you find out who deleted a mailbox in Office 365? ›

    You can use either Audit log search (UI) or PowerShell to see who deleted an email in Outlook. Audit log search: In the audit log search, you can filter out the above-mentioned 'message delete events' to track the deleted emails. Also, you can download the audit log search results to a CSV file.

    Can a deleted email be traced in Outlook? ›

    If you can't find an item in the Deleted Items folder, the next place to look is the Recoverable Items folder. In the left pane, select the Deleted Items folder. At the top of the message list, select Recover items deleted from this folder. Select the items you want to recover and select Restore.

    How do I view mailbox audit logs in Office 365? ›

    Reviewing Mailbox Audit Logs #

    Sign in to the Security & Compliance Center with your Office 365 Admin user account. Select Search & Investigation, and then select Audit log search.

    How do I view mailbox audit logs? ›

    Searching the mailbox audit log

    Synchronously search a single mailbox: You can use the Search-MailboxAuditLog cmdlet to synchronously search mailbox audit log entries for a single mailbox. The cmdlet displays search results in the Exchange Management Shell window.

    Can email is tracked if it is deleted? ›

    Yes. Very simply. The email comes from an email server, and it is very easy to determine which server from each email sent from the account. The server will have logs of that deleted account and its activity.

    How do I audit a shared mailbox in Office 365? ›

    How to Detect Who Was Accessing Shared Mailbox in Office 365
    • Open Exchange Administration Center → Navigate to "Compliance Management" Auditing.
    • Click "Run a non-owner mailbox access report". ...
    • To view non-owner access to a specific mailbox Click on a mailbox to view all non-owner access events with the details.

    Does Outlook have an audit trail? ›

    Summary. In Microsoft 365, you can run mailbox audit logs to determine when a mailbox was updated unexpectedly or whether items are missing from a mailbox. You may have to do this, for example, if items are moved or if they're deleted unexpectedly or incorrectly.

    How do I export mailbox audit logs? ›

    Export the mailbox audit log
    1. In the EAC, go to Compliance Management > Auditing.
    2. Click Export mailbox audit logs.
    3. Configure the following search criteria for exporting the entries from the mailbox audit log: Start and end dates: Select the date range for the entries to include in the exported file. ...
    4. Click Export.
    Jan 27, 2023

    Can you recover permanently deleted emails from Office 365? ›

    If an item is still in your Deleted Items folder, it can still be recovered (Outlook 2013, Outlook 2016, Microsoft 365). Just locate the item and move it back to the proper location in your folder list. You can't recover a file that's been permanently deleted.

    How do I see user activity in Office 365? ›

    You can view active users in the Office 365 report by choosing the Active users tab. The Active Users report can be viewed for trends over the last 7 days, 30 days, 90 days, or 180 days.

    Is Microsoft 365 audit log search enabled? ›

    Audit logging is turned on by default for Microsoft 365 and Office 365 enterprise organizations.

    How do I audit user activity in Office 365? ›

    Go to the Microsoft 365 Security & Compliance Center. Go to Search and then Audit log search. Click Turn on auditing by clicking the Start recording user and admin activity banner.

    How can we trace and audit emails on Office 365 OWA? ›

    Exchange Audit Logs in Office 365

    To search for them, you'll have to log on to Office 365 with an admin account, go to the Office 365 Security & Compliance or the newer Microsoft 365 compliance portal, and navigate to the Audit log search.

    How do I turn on mailbox auditing? ›

    Manually enable mailbox auditing on individual mailboxes (run the command, Set-Mailbox -Identity <MailboxIdentity> -AuditEnabled $true ). After you do this, you can use audit log searches in the Microsoft Purview compliance portal or via the Office 365 Management Activity API.

    Where are Office 365 audit logs stored? ›

    You can find Office 365 audit logs in the Microsoft Purview Compliance Center. While other logs are limited in scope to a particular service, these are collected from multiple Office 365 services and consolidated into a single, searchable log (and they catch page and file views).

    Can my employer read my deleted emails? ›

    In general, many employers have written policies that permit them to monitor your email. These policies often allow employers to access any information sent or received over the company's server - including deleted messages!

    Can hackers see permanently deleted emails? ›

    The good news here is that for the most part, hackers can't access emails that are deleted permanently from the Trash folder. However, email ISPs keep backup copies of client inboxes, and in some cases these deleted messages can be retrieved, usually through a court order.

    Can my boss read my emails? ›

    Employers are free to monitor these communications, as long as there's a valid business purpose for doing so. Many companies reinforce this right by giving employees written notice (for example, in an employee handbook) that their work email isn't private and that the company is monitoring these messages.

    What is mailbox auditing? ›

    By turning on mailbox auditing, Microsoft 365 back office teams can track logons to a mailbox as well as what actions are taken while the user is logged on. After you turn on mailbox audit logging for a mailbox, you can search the audit log for mailbox activity.

    Can Office 365 admin view user's mailbox? ›

    Assign permissions to the entire mailbox

    The user will be able to view the contents of the mailboxes from either Outlook or Outlook Web App. For more information, see How to use Windows PowerShell to grant an admin access to all user mailboxes in Microsoft 365.

    How do I find audit logs for shared mailbox? ›

    Now that auditing is enabled, you can run a report in the Exchange Admin Center to list who is accessing audited mailboxes.
    1. Log in to the Exchange Admin Center (EAC) here.
    2. On the left of EAC, click compliance management.
    3. Click auditing. ...
    4. Click Run a non-owner mailbox access report.

    Does Outlook have an activity log? ›

    If you get an email about unusual activity on your Microsoft account, or if you're worried that someone else might have used your account, go to the Recent activity page. You'll see when your Microsoft account was signed in during the last 30 days, along with any device or app-specific info.

    How do I extract audit logs in Office 365? ›

    The first step is to search the audit log and then export the results in a comma-separated value (CSV) file to your local computer.
    • Run an audit log search and revise the search criteria if necessary until you have the desired results.
    • On the search results page, select Export.
    Mar 16, 2023

    How do I fetch audit logs? ›

    Run the Get-AuditLogSearch cmdlet to return a list of pending audit log searches. If an audit log search has been completed, it won't be displayed in the list of audit log searches.

    How do I pull audit logs? ›

    Click Audit log reports in the Site Collection Administration section. Select the report that you want, such as Deletion on the View Auditing Reports page, . Type a URL or Browse to the library where you want to save the report and then click OK.

    How long does 365 keep deleted emails? ›

    This is called a Permanent Deletion. This also happens if you actively choose to empty your Deleted Items folder. After a further 14 days, your item is moved from the Deletions folder to the Purges folder. After another 14 days, items in the Purges folder are discarded and are no longer available.

    What happens to deleted emails in Office 365? ›

    Notes: Email is automatically deleted from your Deleted Items folder after 30 days. Items removed from your Deleted Items folder are recoverable for 30 days. Junk email is retained for 30 days before it is automatically deleted.

    What happens when you delete an email in Office 365? ›

    After you delete an email in Office 365, it is automatically moved to the Deleted Items folder. It will remain in there until the Deleted Items folder is emptied, either by using the empty deleted items option or the emptying the deleted items folder when I sign out option.

    Does Office 365 track activity? ›

    In the Microsoft 365 admin center, you can access activity reports for multiple items, such as Email, Mailbox usage, Active users, Office activations, and many more.

    How do I track Email activity in Outlook? ›

    Outlook keeps track of your delivery and read receipts. To view that information, open your sent items, and double-click a message. Then, click Tracking. And you can see when the receipts arrived in your inbox, and the recipient names.

    How do I find out when a user was deleted in Office 365? ›

    Open the SCC -> Search & Investigation -> Audit Log Search. Under the Activities menu, select "Changed User License" and/or any other operations you are interested in. Configure other details as necessary and do the search. Was this reply helpful?

    Can Office 365 audit logs be deleted? ›

    Go to Settings > Auditing. Select the oldest audit log. Then, on the command bar, choose Delete Logs. In the confirmation message, choose OK.

    What type of log can you find under audit logs? ›

    Audit logs allow you to search, review, and export logs regarding account access and configuration changes made by administrators. This applies to Administrators responsible for monitoring changes and events that have occurred in their account.

    How far back do Office 365 audit logs go? ›

    You can retain audit logs for up to 10 years. You can create policies based on the following criteria: All activities in one or more Microsoft 365 services. Specific activities (in a Microsoft 365 service) performed by all users or by specific users.

    How to view a detail report of inactive users in Office 365? ›

    View inactive users
    1. In the admin center, go to Reports > Usage page.
    2. Review the Product Reports to identify the user(s) with no activity.
    3. Most people use Email so Exchange would be a good report to start with.
    4. Confirm inactivity of a user by looking at other Product reports.
    Feb 21, 2023

    Which two activities will the audit logs capture? ›

    Audit logs capture the following types of information:
    • Event name as identified in the system.
    • Easy-to-understand description of the event.
    • Event timestamp.
    • Actor or service that created, edited, or deleted the event (user ID or API ID)
    • Application, device, system, or object that was impacted (IP address, device ID, etc.)

    What is Microsoft 365 audit? ›

    Microsoft Purview Audit (Premium) helps organizations to conduct forensic and compliance investigations by increasing audit log retention required to conduct an investigation, providing access to crucial events (by using Audit log search in the Microsoft Purview compliance portal and the Office 365 Management Activity ...

    How do I find out who deleted a shared folder? ›

    Reviewing events
    1. Open the Event Viewer and search the security log for event ID 4656 with a task category of "File System" or "Removable Storage" and the string "Accesses: DELETE".
    2. Review the report. The "Subject: Security ID" field will show who deleted each file.

    Does deleting an email from a shared mailbox delete it for everyone? ›

    Send an email to the trash by using Gmail's 'trash/delete' button. In this case, the email gets removed from the shared mailbox for all the users. The email can be found in the Trash folder of the person who deletes it.

    Can administrators see deleted emails? ›

    Administrators can search for and recover deleted email messages in a user's mailbox.

    How do I find out who deleted a user? ›

    Using PowerShell:
    1. Press Start, search for Windows PowerShell, right-click on it, and select Run as administrator.
    2. Type the following script into the console: Get-EventLog -LogName Security | Where-Object {$_.EventID -eq 4726} | Select-Object -Property *
    3. Press Enter.
    4. This script will display deleted user accounts.

    Will the owner know if I remove someone from a shared file? ›

    ANSWER: Nothing will happen if someone deletes a folder you shared with them. They will lose access& that's it. This is& again& because they are not the owner of the folder.

    How do I enable auditing for file deletion? ›

    Select and hold (or right-click) the file or folder that you want to audit, select Properties, and then select the Security tab. Select Advanced. In the Advanced Security Settings dialog box, select the Auditing tab, and then select Continue.

    What happens when you delete an email from a shared mailbox? ›

    When you use Microsoft Outlook to delete items from a mailbox folder of another user for whom you have deletion privileges, the deleted items go to your own Deleted Items folder instead of the Deleted Items folder of the mailbox owner.

    What happens when you delete a shared mailbox in Office 365? ›

    Click on Delete Account to remove the shared mailbox from your mobile device. This will not impact any of the data in the shared mailbox. By choosing Delete Account you will simply be removing access from Outlook mobile.

    Does deleting an email in Outlook delete on all devices? ›

    So when you delete an email on your desktop computer, it will still be on your mobile device. And vice versa. This is "reassuring" to some people, as they like to know that a "copy" of the email will always be "archived" on their local computer.

    How do I view shared mailbox activity? ›

    How to Detect Who Was Accessing Shared Mailbox in Office 365
    1. Open Exchange Administration Center → Navigate to "Compliance Management" Auditing.
    2. Click "Run a non-owner mailbox access report". ...
    3. To view non-owner access to a specific mailbox Click on a mailbox to view all non-owner access events with the details.

    What is mailbox auditing in Office 365? ›

    Manage mailbox auditing - Microsoft Purview (compliance)

    This configuration means that certain actions performed by mailbox owners, delegates, and admins are automatically logged in a mailbox audit log, where you can search for activities performed on the mailbox.

    Who contains the deleted emails? ›

    Deleted email are usually stored for a defined time at the trash folder.

    Top Articles
    Latest Posts
    Article information

    Author: Ray Christiansen

    Last Updated:

    Views: 5959

    Rating: 4.9 / 5 (69 voted)

    Reviews: 92% of readers found this page helpful

    Author information

    Name: Ray Christiansen

    Birthday: 1998-05-04

    Address: Apt. 814 34339 Sauer Islands, Hirtheville, GA 02446-8771

    Phone: +337636892828

    Job: Lead Hospitality Designer

    Hobby: Urban exploration, Tai chi, Lockpicking, Fashion, Gunsmithing, Pottery, Geocaching

    Introduction: My name is Ray Christiansen, I am a fair, good, cute, gentle, vast, glamorous, excited person who loves writing and wants to share my knowledge and understanding with you.