An Admin's Guide to Navigating Audit Logs in Office 365 (2024)

Office 365 Audit logs are your go-to resource if you’re interested in what’s going on in your environment, be that managing Office 365 Groups, or what’s going on with your various resources on Azure, or even who is accessing and moving files around.

In some cases, because of regulations, you might need to keepa record of the various actions that are performed on the environment. Since Office 365 has a rigid data retention period for Office 365 audit logs, you might even need to handle and store them using a custom solution.

We’ve already talked about audit logs on SharePoint On-premises in theSharePoint Audit Logs: A Key to Better SharePoint Managementblog.The reasonswhy you might want to keep the Office 365 audit logs at hand hasn’t changed that much in the move from SharePoint On-premises to Office 365.

If we call SharePoint On-premises a complex platform, Office 365 is a huge ecosystem containing multiple interconnected services (Exchange, Teams, Azure, and OneDrive, just to name themore popularones). Any solution that tracks Office 365 activity for the purposes of auditing must include activity made on the services that make up the platform.

Now, what options do we have when we need to do Office 365 auditing? A few, and I’ll give an overview of SharePoint’s audit log reports and Office 365 audit logs for admins.

SharePointOnline audit log reports

If you’ve worked with SharePoint On-premises and have seen its audit logs, you’ll notice a lot has stayed the samein its move to the cloud. These logs can answer most of the questions you might have regarding your SharePoint sites. The SharePoint Online audit log reports will give you information about:

  • Edited items
  • Checked-out and checked-in items
  • Items that have been moved and copied to other locations in the site collection
  • Deleted and restored items
  • Changestocontent typesand columns
  • Search queries
  • Changestouser accounts and permissions
  • Changed audit settings and deleted audit log events
  • Workflow events
  • Custom events

There is no longer an option to record opened, downloaded, and viewed items in the cloud version. I would guess that was changed in order to reduce the resource cost on Microsoft’s side since those events are the most frequently occurring and usually the least critical. But I can’t find any official article on this omission.

How to turn on Office 365 audit logs

To enable Office 365 auditing, SharePoint audit logging needs to be set up for each site collection separately, but you can automate it with a simple PowerShell script and a list of your site collections.

SharePointOnline’saudit logs have a few constraints.The minor one is that youcannot access the raw audit log dataprogrammatically.Unlike on-premises, there is no endpoint you can connect to if you want to access the collected records to create custom reports.

You can however choose from a selection of Excel reports that should satisfy most of your needs, but you’ll have to generate reports for each site collection separately. This also means that if you want to process the data further, you’re stuck with downloading and parsing Excel documents.

The bigger constraint relates to what is not collected: everything outside of SharePoint isignored. In an environment such as Office 365, this means many actions, such as any performed in Azure Active Directory or Exchange for instance,will not be visible here.

Note that these logs have a maximum data retention period of 90 days, which is something Syskit Point can help you with as it can store Office 365 audit logs for longer periods.

Do you want complete Microsoft 365 auditing?

Syskit Point gives youfull visibilityof all administrative actions from multipleadmin centers, workspaces,anduser activities– in one platform.

Learn more

Office 365 audit logs

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.

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 aparticular service, these are collected from multiple Office 365 services and consolidated into a single, searchable log(and they catch page and file views).

How do I know if Office 365 audit logs are enabled?

Audit logs are enabled by default, but Microsoft still recommends checking the auditing status when setting up a new Microsoft 365 tenant.

To check if it’s turned on, navigate to the Audit log search and clicktheStart recording user and admin activitybutton if it is displayed.You will have to wait a few hours for the service to prepare itself for use, but you won’t need to do this more than once per tenant.

Once the preparation on the Office side is complete, audited events will start appearing in the log. Depending on theparticular service, it can take up to 30 minutes or even up to 24 hours for an event to be shown in the audit log. Here’s thefull list of audited services and actions.

How long are Office 365 audit logs kept?

As of October 17, 2023, logs are kept for 180 or 365 days, depending on the license. They can be retained for longer than the default 180 days if the user who generates the audit log (that is, the user who performs the audited activity) is assigned an Office 365 E5 of Microsoft 365 E5 license or has a Microsoft 365 E5 Compliance or E5 eDiscovery and Audit add-on license. It is possible to retain audit logs for up to 10 years, but the user must also be assigned a 10-year audit log retention add-on license in addition to an E5 license. You can find more information on audit log retention policies here.

You canexport the results of a search into aCSV fileto store and analyze further. The format is not made to be read by humans at a glance; it is a CSV file containing JSON objects, but that also makes it easy for processing by an application. The main issue you’ll come across is that most of the properties are lumped into an AuditDataJSON, whichcontains very different properties depending on the audit event.

There’s alsotheoption ofprogrammatically downloadingthe audit logsfor use in your solutions.This way, you can regularly download the newly available events using the available API’s, usingeitherPowerShell or REST.

Accessing audit logsthroughExchange management tools

This method is easier to use since you’ll only need to have PowerShell installed and haveeither theAudit LogsorView-Only Audit Logsroleassigned in Exchange (global admins should have this by default).

To connect to an Exchange Online with PowerShell,this is the script you’ll want to run:

Connect-ExchangeOnline -UserPrincipalName [email protected] -SkipLoadingFormatData

This willestablish a connection to Exchange Onlineand allow you to run cmdlets associated with Exchange. After you’re done with the session, it’s recommended to close it using the following:

Disconnect-ExchangeOnline -Confirm:$false

If you’re having trouble with the execution policy on your machine, you will need to firstrun:

Set-ExecutionPolicy RemoteSigned

The only Exchange cmdlet we’re interested in right now isSearch-UnifiedAuditLog. It has a simple basic signature but allows for a lot of customization (find out morehere).

Search-UnifiedAuditLog -StartDate 04/24/2019 -EndDate 04/25/2019

This command will returnaudit recordsforthe specified date, up to a maximum of 100. You can specify a larger number of recordstoreturn, or you can use paging by specifying aSessionIdand using theReturnNextPreviewPageSessionCommand.

The returned data contains the general data about the event (RecordType, CreationData, UserIds, and Operations) and the AuditData JSON, which contains the event description and whose properties depend on the specific event type.

All the data contained in the Security & Compliance Search can be queried fromhere, which effectivelymeansthey share the same data retention period.This is important to note because the other method differs in this regard.

You can find more info about connecting to Exchange Online by remote PowerShellhere.

Office 365 management API

This API provides access to events from Office 365 audit logs. The data available hereisthe same as shown in the search log, with very few differences.The major one beingyou can only get data for the last 7 days, while others make the data available for up to 90 days.

The audit data is made available using blobs – the service periodically collects events and organizes them into these collections (or blobs), which can then be downloaded. The events contained in the blobs are not in any particularorderbutarebundled up according to the time when the service collected them.

This means that an older event might appear in a very recent blob (according to Microsoft, in case of a service outage, this might mean a delay of 5 days or more). What this means is thatyou cannot use this service for alertssince there is no guarantee an event will be made available in a timely manner.

Ofthe two possible APIsto use to collect Office 365 audit logs,this one isthe recommendedone.

How to start collecting data?

To start collecting this data, you will need to create a new application on your Azure first. Then,using that application,we’llstart subscriptions for the various event content types available. The application requires theActivityFeed.ReadandServiceHealth.Readapplication and delegated permissions, andyou’ll need to generate a client secretto authenticate your application.

An Admin's Guide to Navigating Audit Logs in Office 365 (1)
An Admin's Guide to Navigating Audit Logs in Office 365 (2)

We’ll use the client secretinthe next steps, so make sure to store it somewhere.

The following examples will be written in PowerShell, buttheycan be easily rewritten in almost any other programming language.

Using the following script and the values of your clientId, clientSecret and tenantDomain,we’ll get an access tokenthat we can use in subsequent calls to the API.

$clientID = "00000000-0000-0000-0000-000000000000" $clientSecret = "]t;{K!.;andsomemoregibberish" $tenant = "contoso" $tenantdomain = "$tenant.onmicrosoft.com" $loginURL = "https://login.microsoftonline.com/" $resource = "https://manage.office.com" $body = @{grant_type="client_credentials";resource=$resource;client_id=$clientID;client_secret=$clientSecret} $oauth = Invoke-RestMethod -Method Post -Uri $loginURL/$tenantdomain/oauth2/token?api-version=1.0 -Body $body $headerParams = @{'Authorization'="$($oauth.token_type) $($oauth.access_token)"}

TheheaderParamsattribute now contains the access token. Using this token, we’ll be able to start the subscriptions to each of the audit types (Audit.AzureActiveDirectory,Audit.Exchange,Audit.SharePoint,Audit.General, andDLP.All). To start asubscription,run this command:

Invoke-WebRequest -Method Post -Headers $headerParams -Uri "https://manage.office.com/api/v1.0/$tenant/activity/feed/subscriptions/start?contentType=Audit.AzureActiveDirectory" 

To start a subscriptionforthe otheraudittypes, simply replacethecontentTypeparameter value with the names of the other audit types.

You can check the activated subscriptions with the following:

Invoke-WebRequest -Headers $headerParams -Uri "https://manage.office.com/api/v1.0/$tenant/activity/feed/subscriptions/list"

Assuming the scripts ran successfully, you should now be able to queryforaudit blobs and download their contents like so:

Invoke-WebRequest -Method GET -Headers $headerParams -Uri "https://manage.office.com/api/v1.0/$tenant/activity/feed/subscriptions/content?contentType=Audit.AzureActiveDirectory"

This request will return a JSON object containing contenturisfor events that have been made available today. You can choose a different time period byspecifying astartTimeandendTimeparameter(both need to be specified and must not span more than 24 hours).

Invoke-WebRequest -Method GET -Headers $headerParams -Uri "https://manage.office.com/api/v1.0/$tenant/activity/feed/subscriptions/content?contentType=Audit.AzureActiveDirectory&startTime=2019-04-25T00:00&endTime=2019-04-25T11:59"

In any case, the returned JSON object should containuriswe can use to collect events collected in the time period (remember, we don’t have a guarantee the eventactually occurredin that time period, only that it was collected then).An example of such a request anduriwould look like this:

Invoke-WebRequest -Method GET -Headers $headerParams -Uri 'https://manage.office.com/api/v1.0/00000000-0000-0000-0000-000000000000/activity/feed/audit/20190425071547312049798$20190425071747444061084$audit_azureactivedirectory$Audit_AzureActiveDirectory$emea0035'

This will return a collection of events in a JSON format. The eventshave schemas depending on the audit event type they’re describing.Microsoft has defined about two dozen different schemas (a couple more or less, depending on how you count them since a few are considered base and aren’t used independently of others). Each event will have CreationTime, RecordType, Operation, and ResultStatus properties.

According to its type, it will also have several other properties used to describe thedetails of the action that created the record (these extra details can be found by examining a single row in the Audit log search and expanding theMore informationtab). This can be anything from the user that initiated the action, where the action was made, or what the target was.

How to understand these properties?

Some of these properties are easier to make sense of than others since connecting an email to a particular user is straightforward. But it’s much less so to connect a group id to a group name or a team site id to an Office 365 Group.Microsoft hasdocumented the schemas and their properties,but note that some record types are not officially documented.

You can find out more about the Office 365 Management API by checking outthe official resources.

If we compare the PowerShell API to the REST one, we can see that the Search-UnifiedAuditLogcmdlet, with its numerous optional parametersis more suited for searching and filtering logsin search of a specific record, but not so much for collecting new records as they’re coming in since a record’s creation time is not the same time the record was made available. The REST API is much more appropriate for collecting and storing audit records. Since the collection of events in the blobs does not change, you only need to collect new blobs as they become available.

Where Syskit Point comes in

We’ve seen that finding what you’re looking for is rarely easy. Especially if you just want an overview of what’s happening with a given user or site. The default logs are verbose,and because they are generic,they tend not to focus on what is important in a given context.The filters are nice, but you need to know the exactURLof an object beforehand to view the actions associated with it.

The data retention is stingy, although understandably so since Microsoft needs to store a lot of data. And every extra day of data retention they allow means an enormous amount of extra storage space required on their end.For this and other reasons,we’ve made our own custom solution for storing, searching, and exportingOffice 365 audit logs. It stores data locally, meaning you can decide how much of it you want to store and for how long.

It’s easily accessible from most reports,allowing you toeasily check the audit logsrelated to a certainSharePointsiteand theitems in its document libraries, or you caneasily check the list of actions made by or on a certain user. We’ve tried to make it aseasy as possibleto read so you can see what’s importantat a glance.

Know how your sensitive data is being used and accessed

Syskit Point enables you to quickly avoid security breaches and stay compliant with various regulations – all from a single platform.

Try for free

Subscribe to our Newsletter

An Admin's Guide to Navigating Audit Logs in Office 365 (2024)

FAQs

How to read audit logs in Office 365? ›

Log In at https://protection.office.com.
  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.
Jul 30, 2024

How to enable admin audit log in Office 365? ›

Turn on auditing
  1. Sign into the Microsoft Purview portal.
  2. Select the Audit solution card. ...
  3. If auditing isn't turned on for your organization, a banner is displayed prompting you start recording user and admin activity.
  4. Select the Start recording user and admin activity banner.
Mar 26, 2024

What are admin audit logs? ›

Admin Activity audit logs contain log entries for API calls or other actions that modify the configuration or metadata of resources. For example, these logs record when users create VM instances or change Identity and Access Management permissions.

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

Compared to activity logs, audit logs have multiple log name values and different payload values. Audit log entries also return fully qualified resource names and versioned method names.

What is the content of audit log? ›

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.

How do I pull audit logs? ›

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

How long are audit logs kept in Office 365? ›

However, logging capabilities are not turned on by default and the retention period for O365 audit logs varies by license type. An audit log retention policy lets you specify how long to retain audit logs in your organization. Logs are kept for 90 or 365 days, or up to 10 years, depending on the license.

How long does it take for activities to appear in the audit log? ›

It may take up to 24 hours for eDiscovery cmdlet activities to appear in audit log search results.

What is the age limit for audit logs in Office 365? ›

You can change the age limit for audit log records by using the AuditLogAgeLimit parameter on the Set-Mailbox cmdlet in Exchange Online PowerShell. However, increasing this value doesn't allow you to search for events that are older than 90 days in the audit log.

What are the two types of audit logs? ›

Types of Audit Logs

Application Audit Logs: These logs capture events and activities performed by applications, including database queries, transactions, and file operations. Network Audit Logs: These logs capture network events and activities, including network traffic, firewall activity, and access control lists.

What is the difference between audit and audit log? ›

What Are Audits? In contrast to logs and metrics, which are mainly focused on events and actions occurring within a software system, audits capture information about which users are performing actions and when. Audits typically serve legal, compliance, and/or traceability purposes.

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

Use audit logs to investigate user and system behavior. Use debug logs to investigate any issues that can arise in production.

How to use audit logs in Office 365? ›

Set up and enable audit logs in Office 365

Enabling audit logs within your organization requires distinct admin privileges. For example, the Audit Logs role is required to enable audit logs in Exchange Online. These privileges are assigned to global administrators by default.

What should be logged in an audit log? ›

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

What are the disadvantages of audit logs? ›

Let us discuss the disadvantages of audit trail database through the points below. The data logs can be heavy, which leads to an increase in storage costs. It sometimes gets difficult to strike a balance between data protection and operational performance.

How to read mailbox audit logs? ›

Review the audit log
  1. Open the Security & Compliance Center.
  2. Click Search & Investigation -> Click Audit log search.
  3. Filter activities using Activity button on the left pane, click Search.
  4. Click activity you want to review, for example, modified permissions of folder:

How do I view audit history in d365? ›

Log in to Microsoft Dynamics CRM with a user with permission to manage auditing. Navigate to Settings > Auditing > Audit Summary View. Click Enable/Disable Filters to allow the ability to filter logs. Note: It is also possible to view audit logs from a record.

How do I view ad audit logs? ›

Step 1: This can be done by going to your Group Policy management console → Domain policy → Computer configuration → Policies → Windows Settings → Security Settings → Local Policies → Audit Policy/Advanced audit policy configuration. Step 2: Select the events you want to audit.

How to read SQL audit logs? ›

Using SQL Server Management Studio
  1. In Object Explorer, expand the Security folder.
  2. Expand the Audits folder.
  3. Right-click the audit log that you want to view and select View Audit Logs. The Log File Viewer - server_name dialog box opens. For more information, see Log File Viewer F1 Help.
  4. When finished, select Close.
May 21, 2024

Top Articles
How To Activate Windows Server 2016 Through Command Line - DomainRegister International
What Is A Transaction Fee And How Does It Work? | KOHO
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
Non Sequitur
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Hello – Cornerstone Chapel
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Carlyn Walter

Last Updated:

Views: 6040

Rating: 5 / 5 (50 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Carlyn Walter

Birthday: 1996-01-03

Address: Suite 452 40815 Denyse Extensions, Sengermouth, OR 42374

Phone: +8501809515404

Job: Manufacturing Technician

Hobby: Table tennis, Archery, Vacation, Metal detecting, Yo-yoing, Crocheting, Creative writing

Introduction: My name is Carlyn Walter, I am a lively, glamorous, healthy, clean, powerful, calm, combative person who loves writing and wants to share my knowledge and understanding with you.