How to use mailbox audit logs in Microsoft 365 - Office 365 (2024)

  • Article
  • Applies to:
    Exchange Online, Microsoft Exchange Online Dedicated

Original KB number:4021960

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.

For the vNext environment, please note that mailbox audit logs are not enabled by default and need to be turned on for a user before beginning a search.

How to run and check mailbox audit logs

Mailbox audit logging lets users obtain information about actions that are performed by non-owners and administrators. Mailbox audit logging is available to members of the Audit Reporting Mailbox self-service group only by using Windows Remote PowerShell.

Note

  • By default, only non-owner mailbox audit logging is enabled, and owner mailbox audit logging is disabled. If you have to perform owner mailbox audit logging to investigate a specific issue, you can temporarily enable the process for a two-week period.
  • Some organizations may not enable you to use mailbox audit logging and, therefore, have turned off the feature.

To investigate this issue, create and use a Windows PowerShell script by using the sample script that's provided in the Step 1 in this section, and then customize a search. By default, you can investigate actions that are performed by non-owners and administrators. This script exports content in a simplified, comma-separated values (.csv) file to help you troubleshoot reports about items that are missing or that were updated unexpectedly.

Important

Customers are encouraged to use the script that's provided by Microsoft Online Services to help in certain investigations. Microsoft Online Services scripts are generic, and they should be usable in all customer environments. If errors occur when a script is run, the content of the script should be used as an example to create a customized script for a particular customer environment. Microsoft Online Services provides the script as a convenience to Microsoft 365 customers without warranty, expressed or implied.

Step 1: Run the script

To run the script, follow these steps:

  1. Start Notepad, and then copy the following code into the file. The code uses the search-mailboxAuditLog command that is part of Microsoft Exchange Server.

     param ([PARAMETER(Mandatory=$TRUE,ValueFromPipeline=$FALSE)][string]$Mailbox,[PARAMETER(Mandatory=$TRUE,ValueFromPipeline=$FALSE)][string]$StartDate,[PARAMETER(Mandatory=$TRUE,ValueFromPipeline=$FALSE)][string]$EndDate,[PARAMETER(Mandatory=$FALSE,ValueFromPipeline=$FALSE)][string]$Subject,[PARAMETER(Mandatory=$False,ValueFromPipeline=$FALSE)][switch]$IncludeFolderBind,[PARAMETER(Mandatory=$False,ValueFromPipeline=$FALSE)][switch]$ReturnObject)BEGIN { [string[]]$LogParameters = @('Operation', 'LogonUserDisplayName', 'LastAccessed', 'DestFolderPathName', 'FolderPathName', 'ClientInfoString', 'ClientIPAddress', 'ClientMachineName', 'ClientProcessName', 'ClientVersion', 'LogonType', 'MailboxResolvedOwnerName', 'OperationResult') } END { if ($ReturnObject) {return $SearchResults} elseif ($SearchResults.count -gt 0) { $Date = get-date -Format yyMMdd_HHmmss $OutFileName = "AuditLogResults$Date.csv" write-host write-host -fore green "Posting results to file: $OutfileName" $SearchResults | export-csv $OutFileName -notypeinformation -encoding UTF8 } } PROCESS { write-host -fore green 'Searching Mailbox Audit Logs...' $SearchResults = @(search-mailboxAuditLog $Mailbox -StartDate $StartDate -EndDate $EndDate -LogonTypes Owner, Admin, Delegate -ShowDetails -resultsize 50000) write-host -fore green '$($SearchREsults.Count) Total entries Found' if (-not $IncludeFolderBind) { write-host -fore green 'Removing FolderBind operations.' $SearchResults = @($SearchResults | ? {$_.Operation -notlike 'FolderBind'}) write-host -fore green 'Filtered to $($SearchREsults.Count) Entries' } $SearchResults = @($SearchResults | select ($LogParameters + @{Name='Subject';e={if (($_.SourceItems.Count -eq 0) -or ($_.SourceItems.Count -eq $null)){$_.ItemSubject} else {($_.SourceItems[0].SourceItemSubject).TrimStart(' ')}}}, @{Name='CrossMailboxOp';e={if (@('SendAs','Create','Update') -contains $_.Operation) {'N/A'} else {$_.CrossMailboxOperation}}})) $LogParameters = @('Subject') + $LogParameters + @('CrossMailboxOp') If ($Subject -ne '' -and $Subject -ne $null) { write-host -fore green 'Searching for Subject: $Subject' $SearchResults = @($SearchResults | ? {$_.Subject -match $Subject -or $_.Subject -eq $Subject}) write-host -fore green 'Filtered to $($SearchREsults.Count) Entries' } $SearchResults = @($SearchResults | select $LogParameters) }
  2. On the File menu, click Save As.

  3. In the Save as type box, click All File.

  4. In the File name box, type Run-MailboxAuditLogSearcher.ps1, and then click Save.

  5. Start Windows PowerShell, and then connect to Windows Remote PowerShell.

  6. Locate the directory in which you saved the script, and then run the script.

    .\Run-MailboxAuditLogSearcher.ps1

    Note

    • If you run the script without parameters, you will be prompted for the following default parameters:
      • Mailbox
      • StartDate
      • EndDate
    • To search for entries from the current day, add one day to the end-date value in the prompt window. For example, if the current date is 3/14/2017, and you want to include the current day in your search, enter 3/15/2017 as the end date.

Step 2: Customize a mailbox audit log search

In Microsoft 365, mailbox audit logging entries are retained in the mailbox for 90 days. You are prompted to indicate a start date and end date for the search. You can use several optional parameters to customize the search. For a description of these parameters, see the 'More Information' section.

If items are found after the script runs, you receive a message that resembles the following:

How to use mailbox audit logs in Microsoft 365 - Office 365 (1)

This example message indicates that the search process has found 11 entries. By default, the FolderBind entries are filtered out, and the following operation types remain:

  • Copy
  • Create
  • HardDelete
  • MessageBind
  • Move
  • MoveToDeletedItems
  • SendAs
  • SendOnBehalf
  • SoftDelete
  • Update

Note

The FolderBind operation indicates the times at which the mailbox is accessed by a non-owner. This is the most common operation. You do not have to view the FolderBind operations when you investigate an item that is updated or deleted.

Review the output of the .csv file. The most useful columns are exported, and some of these columns are merged to make the output easier to review. For more information about the columns that are exported, see the 'More Information' section.

Owner mailbox audit logging

By default. owner audit logging is not turned on. It should only be used if you have to investigate an action by the owner of the mailbox. It should be used for a limited time period, approximately two weeks. This is because the audit log entries are stored in the mailbox, and this may cause the mailbox dumpster to exceed the size limit.

To enable owner audit logging, follow these steps:

  1. Determine whether mailbox audit logging is enabled. To do this, run the following cmdlet:

    Get-Mailbox <useridentity> | ft AuditEnabled
  2. If the result is True, skip this step. If the result is False, run the following cmdlet in Windows PowerShell:

    Set-Mailbox <useridentity> -AuditEnabled $true
  3. Enable the owner audit logging. To do this, run the following cmdlet:

    Set-Mailbox <useridentity> -AuditOwner "Create,HardDelete,Move,MoveToDeletedItems,SoftDelete,Update"
  4. Rerun the Run-MailboxAuditLogSearcher.ps1, and review the data.

  5. After the troubleshooting is complete, disable owner audit logging. To do this, run the following cmdlet:

    Set-Mailbox <useridentity> -AuditOwner $none

More Information

Optional script parameters

The following list describes optional parameters that generate different results when they are used together with the Run-MailboxAuditLogSearcher script:

  • IncludeFolderBind: When you use this switch, the FolderBind operation is not filtered from the output. You can use FolderBind information to investigate mailbox access issue.

    For example, the following cmdlet searches the "Test User 1" mailbox and includes all operations:

    .\Run-MailboxAuditLogSearcher.ps1 -IncludeFolderBind -Mailbox "<Test User 1gt;" -StartDate "<04/10/17gt;" -EndDate "<04/27/17gt;&quot
  • Subject: When you use this switch, you can specify the subject of an item in order to limit the search for operations that are performed on that item.

    For example, the following cmdlet filters out all output except items that have the subject set as 'Good News':

    .\Run-MailboxAuditLogSearcher.ps1 -Subject "<Good News>" -Mailbox "<test1@contoso.comgt;" -StartDate "<04/10/17gt;" -EndDate "<04/27/17gt;&quot
  • ReturnObject: When you use this switch, the result is displayed on the screen, but it is not exported to a .csv file.

    For example, the following cmdlet displays the output on the screen:

    .\Run-MailboxAuditLogSearcher.ps1 -ReturnObject -Mailbox "<Test User 1gt;" -StartDate "<04/10/17gt;" -EndDate "<04/27/17gt;&quot

Exported columns from the .csv file

The most useful columns of the .csv file are exported. Some of these columns are merged to make the output easier to review. The following table lists the columns that are exported.

ColumnDescription
SubjectSubject of item
OperationActions that are performed on item
LogonUserDisplayNameDisplay name of user who is logged o
LastAccessedTime at which the operation was performed
DestFolderPathNameDestination folder for the move operation
FolderPathNamePath of folder
ClientInfoStringDetails about the client that performs the operation
LastAccessedIP address for the client computer
ClientMachineNameName of the client computer
ClientProcessNameName of the client application process
ClientVersionVersion of the client application
LogonTypeLogon type of the user who performs the operationNote Logon types includes the following: - Delegate for non-owner - Administrator - Mailbox owner (not logged by default)
MailboxResolvedOwnerNameResolved name of mailbox userNote Resolved name is in the following format:Domain\SamAccountName
OperationResultStatus of the operationNote Operation results include the following: - Failed - PartiallySucceeded - Succeeded
CrossMailboxOperationInformation about whether the operation logged is a cross-mailbox operation (for example, copying or moving messages among mailboxes)

More information about mailbox audit logging

  • The Search-MailboxAuditLog cmdlet is used in the sample script in Step 1 to search a single mailbox synchronously. You can also do this by running the cmdlet in Windows Remote PowerShell.

    For more information about the cmdlet, go to the following TechNet article:

    Search-MailboxAuditLog

  • You can search one or more mailboxes asynchronously. To do this, run the following cmdlet in Windows Remote PowerShell:

    New-MailboxAuditLogSearch

    For more information about this cmdlet, go to the following TechNet article:

    New-MailboxAuditLogSearch

    For more information about the default mailbox audit logging entries, go to the 'Mailbox audit log entries' section of the following TechNet article:

    Mailbox Audit Logging in Exchange 2016

How to use mailbox audit logs in Microsoft 365 - Office 365 (2024)

FAQs

How do I use mailbox audit logs in Microsoft 365? ›

Sign in to the Security & Compliance Center with your Office 365 Admin user account. Select Search & Investigation, and then select Audit log search. Select the activities you want to audit. For example, mailbox activities such as one or more users signing into their mailbox or purging email.

How do I run audit logs in Office 365? ›

To run an audit log search:
  1. Start a New Search. In the Security & Compliance Center, click Search, Audit log search.
  2. Configure Your Search Criteria. The main criteria to specify are: ...
  3. Filter the Search Results. Filtering the search results will help you analyze the data more effectively. ...
  4. Save your Results.
Oct 7, 2022

How do I read mailbox audit logs? ›

You can use the following methods to search mailbox audit log entries: 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.

How do I run a mailbox audit? ›

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.

What is the role of audit log in o365? ›

Office 365 Audit logs capture details about system configuration changes and access events, with details to identify who was responsible for the activity, when and where the activity took place, and what the outcome of the activity was.

How do I get my mailbox usage report in Office 365? ›

How to get to the mailbox usage report
  1. In the admin center, go to the Reports > Usage page.
  2. Select View More under Email activity.
  3. From the Email activity drop-down list, select Exchange > Mailbox usage.
Mar 1, 2023

How long are audit logs kept in Office 365? ›

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 do you query audit logs? ›

In Resource type, select the Google Cloud resource whose audit logs you want to see. In Log name, select the audit log type that you want to see: For Admin Activity audit logs, select activity. For Data Access audit logs, select data_access.

How to read Exchange audit log? ›

Use the EAC to view the admin audit log

In the EAC, go to Compliance management > Auditing, and then choose Run the admin audit log report.

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 do I run an audit log in Outlook? ›

Enable auditing
  1. Open the Security & Compliance Center.
  2. Click Search & Investigation -> Click Audit log search -> Click Start recording user and admin activity.

How do I view activity logs in Office 365? ›

Steps to check login activity using M365 Manager Plus
  1. Go to Reports under Management & Reporting.
  2. Navigate to Azure Active Directory → User Reports → User Logon Reports.
  3. Choose the User Logon Activity report.
  4. Enter the Microsoft 365 Tenant.

How do I read audit logs in Windows? ›

To view the security log
  1. Open Event Viewer.
  2. In the console tree, expand Windows Logs, and then click Security. The results pane lists individual security events.
  3. If you want to see more details about a specific event, in the results pane, click the event.
Feb 16, 2023

What is mailbox audit log? ›

Mailbox audit logging lets users obtain information about actions that are performed by non-owners and administrators.

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.

How will a mailbox audit log be exported? ›

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.
Feb 21, 2023

What can audit logs be used for? ›

Audit log has records providing information about who has accessed the system and what operations he or she has performed during a given period of time. Audit logs are useful both for maintaining security and for recovering lost transactions.

What are audit logs good for? ›

Audit logs contain detailed historical information that can be used to reconstruct the timeline of a system outage or incident. For instance, logs can help distinguish between operator error and system error.

What function will an audit log provide? ›

Audit trails (or audit logs) act as record-keepers that document evidence of certain events, procedures or operations, so their purpose is to reduce fraud, material errors, and unauthorized use.

How do I track messages in Office 365? ›

Open message trace

In the Microsoft 365 Defender portal at https://security.microsoft.com, go to Email & collaboration > Exchange message trace. To go directly to the message trace page, use https://admin.exchange.microsoft.com/#/messagetrace.

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.

Where do you manage the mailboxes in Office 365? ›

  1. Click the Office 365 tab.
  2. Select Management from the left navigation section and click Mailbox Management.
  3. Under the Shared Mailbox Tasks category, select the MailTip Settings option.
  4. If you want to enable the MailTip settings:
  5. If you want to disable the MailTip settings, select the Remove MailTip option.

What is the disadvantage of audit logs? ›

Impossible to check all transactions – The key disadvantage of performing an audit is that it is impossible to check all transactions that are taking place in the company. This makes constant monitoring a challenge for audits in business settings.

What is the best practice for audit log retention? ›

Centralize Your Logs

That's why the most important log retention best practice is to archive logs into a central repository, such as a security information and event management (SIEM) platform. A SIEM not only collects logs, but it correlates logs and other security-related documentation for analysis.

How much storage is needed for audit logs? ›

As a general rule, storage of audit logs should include 90 days “hot” (meaning you can actively search/report on them with your tools) and 365 days “cold” (meaning log data you have backed up or archived for long-term storage).

Which two activities will the audit logs capture? ›

Audit logs capture details about system configuration changes and access events, with details to identify who was responsible for the activity, when and where the activity took place, and what the outcome of the activity was.

What are the different types of audit logs? ›

There are four types of audit logs that you'll work with. They include Admin Activity audit logs, Data Access audit logs, System Event audit logs, and Policy Denied audit logs. These logs are used to track down who did what, where they did it, and when.

What should you include in audit logs? ›

Log events in an audit logging program should at minimum include:
  • Operating System(OS) Events. start up and shut down of the system. ...
  • OS Audit Records. log on attempts (successful or unsuccessful) ...
  • Application Account Information. successful and failed application authentication attempts. ...
  • Application operations.

What is the difference between audit log and activity log? ›

The audit log displays a timeline of changes made to fields on a record; the historical summary shows activities like calls and meetings that are related to a record; and the record's activity stream shows changes, linked records, and user comments.

What is the difference between audit and activity log? ›

The activity log includes information like when a resource is modified or a virtual machine is started. Audit Logs - All resource logs that record customer interactions with data or the settings of the service. Next time, do not forget to include a link to the documentation you are referring to.

What is the difference between audit logs and transaction logs? ›

Transaction Log - captures all changes to data caused by end users, rules or processes. Audit Log - captures changes to metadata, security, logon information and other system activity detail.

What is an example of audit logging? ›

Examples of events that should be audit logged are as follows: application specific user activities, exceptions, information security events (successful and rejected events), use of privileges, log-on failed-attempts & successes, log-off, data accessed, data attempted to be accessed, administrative configuration ...

How do I ensure Microsoft 365 audit log search is enabled? ›

To enable Microsoft 365 audit log search, use the Microsoft 365 Admin Center: Log in as an administrator. In the Security & Compliance Center, expand Search then select Audit log search. Click Start recording user and admin activities next to the information warning at the top.

How do I view folder audit logs? ›

To view this audit log, go to the Event Viewer. Under Windows Logs, select Security. You can find all the audit logs in the middle pane as displayed below. Search the Security Windows Logs for the event ID 4656 with the Audit Failed keyword to find out who tried changing a file or folder.

What happens in an office audit? ›

In an office audit, a representative from the Internal Revenue Service (IRS) interviews the taxpayer and inspects the taxpayer's records in-person, usually at an IRS office. The purpose of an office audit is to make sure the taxpayer is accurately reporting income and deductions and paying the lawful amount of tax.

Why do an email audit? ›

An email audit helps you to review the deliverability of your email marketing campaign. It helps to detect issues that might exist and can thus help you mitigate potential email security risks. There are two different ways for carrying out an email audit: Internal audit (carried out by members of the organization)

Where are auditd logs stored? ›

By default, the Audit system stores log entries in the /var/log/audit/audit. log file; if log rotation is enabled, rotated audit. log files are stored in the same directory.

How an audit log can be used as recovery tool? ›

Recovering Data

With the Audit Log you can reduce the risk of data loss and handle such cases on your own, quickly and easily. You can find the deleted Records in a Form, Folder or in the entire Database and review which user deleted them and when.

How long should audit logs be stored? ›

As a baseline, most organizations keep audit logs, IDS logs and firewall logs for at least two months. On the other hand, various laws and regulations require businesses to keep logs for durations varying between six months and seven years. Below you can find some of those regulations and required durations.

How do I access Exchange audit logs? ›

Use the EAC to view the admin audit log

In the EAC, go to Compliance management > Auditing, and then choose Run the admin audit log report.

Top Articles
How to Lower Your Mortgage Payment by Refinancing
Debt Consolidation for Senior Citizens: Strategies to Get Out of Debt
Dragon Age Inquisition War Table Operations and Missions Guide
Minooka Channahon Patch
Star Sessions Imx
Canary im Test: Ein All-in-One Überwachungssystem? - HouseControllers
Don Wallence Auto Sales Vehicles
Meer klaarheid bij toewijzing rechter
Bucks County Job Requisitions
Lesson 2 Homework 4.1
Conduent Connect Feps Login
How Many Cc's Is A 96 Cubic Inch Engine
5808 W 110Th St Overland Park Ks 66211 Directions
Craigslist Alabama Montgomery
New Stores Coming To Canton Ohio 2022
Check From Po Box 1111 Charlotte Nc 28201
U Arizona Phonebook
Mikayla Campinos Laek: The Rising Star Of Social Media
Missed Connections Inland Empire
Juicy Deal D-Art
Johnnie Walker Double Black Costco
Pecos Valley Sunland Park Menu
Buying Cars from Craigslist: Tips for a Safe and Smart Purchase
Craigslist Roseburg Oregon Free Stuff
Globle Answer March 1 2023
How Taraswrld Leaks Exposed the Dark Side of TikTok Fame
Lines Ac And Rs Can Best Be Described As
2000 Ford F-150 for sale - Scottsdale, AZ - craigslist
When His Eyes Opened Chapter 3123
Speechwire Login
Craigslist Comes Clean: No More 'Adult Services,' Ever
Schooology Fcps
Astro Seek Asteroid Chart
Sinfuldeed Leaked
A Plus Nails Stewartville Mn
Delta Rastrear Vuelo
Craigslist Gigs Norfolk
Metra Union Pacific West Schedule
The Legacy 3: The Tree of Might – Walkthrough
Timothy Kremchek Net Worth
Metra Schedule Ravinia To Chicago
Deshuesadero El Pulpo
Shane Gillis’s Fall and Rise
Oppenheimer Showtimes Near B&B Theatres Liberty Cinema 12
Sour OG is a chill recreational strain -- just have healthy snacks nearby (cannabis review)
2013 Honda Odyssey Serpentine Belt Diagram
Spreading Unverified Info Crossword Clue
Hillsborough County Florida Recorder Of Deeds
Wpne Tv Schedule
2121 Gateway Point
Cbs Scores Mlb
Latest Posts
Article information

Author: Gov. Deandrea McKenzie

Last Updated:

Views: 6433

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Gov. Deandrea McKenzie

Birthday: 2001-01-17

Address: Suite 769 2454 Marsha Coves, Debbieton, MS 95002

Phone: +813077629322

Job: Real-Estate Executive

Hobby: Archery, Metal detecting, Kitesurfing, Genealogy, Kitesurfing, Calligraphy, Roller skating

Introduction: My name is Gov. Deandrea McKenzie, I am a spotless, clean, glamorous, sparkling, adventurous, nice, brainy person who loves writing and wants to share my knowledge and understanding with you.