Respond to Security Incidents · Topic 5 of 5

Investigating Microsoft 365 Activities

SC-200 Microsoft 365 investigations: Purview Audit operations and retention, content search with purge, and Microsoft Graph activity logs.

  • 6 min
In a nutshell
  • Audit (Standard) keeps 180 days. Advanced hunting keeps 30.
  • MailItemsAccessed shows read mail. SearchQueryInitiatedExchange shows mailbox search terms. CopilotInteraction shows Copilot prompts.
  • The deletion operations are MoveToDeletedItems, SoftDelete and HardDelete. Move records a folder move.

What it is

After a compromise, the key question is what the attacker actually did: which mail they read, which files they touched, which settings they changed. Microsoft 365 records this activity. This page covers three sources that a SOC analyst uses: Microsoft Purview Audit, content search in Microsoft Purview eDiscovery, and the Microsoft Graph activity logs.

Purview Auditwho did what and whenContent searchfind and purge contentGraph activity logsAPI calls to Microsoft Graph

How it works

Microsoft Purview Audit

Audit records user and admin activity across Exchange, SharePoint, OneDrive, Teams, Entra ID and more. You search it in the Microsoft Purview portal with a date range, users and activities, and the results list the time, the user, the operation and the item.

EditionRetention
Audit (Standard)180 days, enabled by default
Audit (Premium)Longer retention, with a 10 year add on, and extra detail on some events

Useful operations when investigating a compromised account:

QuestionOperation
Which mail items did the attacker read?MailItemsAccessed
Which keywords did the attacker type in the mailbox search box?SearchQueryInitiatedExchange (and SearchQueryInitiated for other workloads)
Did they create a forwarding or inbox rule?New-InboxRule, Set-InboxRule
Which folders did they open?FolderBind
What mail did they delete?SoftDelete, HardDelete, MoveToDeletedItems, Move
Which files did they download or share?FileDownloaded, FileAccessed, SharingSet
What did a user ask Microsoft 365 Copilot?CopilotInteraction, which records prompts and the resources they referenced
Which role or setting was changed?Audit records of Entra ID and admin operations

For deletions, the operations separate the steps: MoveToDeletedItems is a move to the Deleted Items folder, SoftDelete is removal from Deleted Items into Recoverable Items, and HardDelete is a purge from Recoverable Items. Move records a move to another folder.

Because advanced hunting keeps only 30 days of data, and Audit keeps data for at least 180 days, an incident that began 75 days ago, such as SharePoint activity, can be investigated with an Audit search even though a hunting query on CloudAppEvents returns nothing for the early weeks. Extending a query's time range cannot return data that no longer exists.

Audit logs can also be exported or searched through PowerShell and the Office 365 Management Activity API, to feed a SIEM.

Content search in Microsoft Purview eDiscovery

A content search finds content in mailboxes, SharePoint sites, OneDrive accounts and Teams, using keywords and conditions such as date, sender and subject. For threat response, its power is that it works on the content itself, with no 30 day limit like Threat Explorer.

  • Build a query, such as the subject and sender of a phishing message.
  • Choose the locations: specific mailboxes or all mailboxes.
  • Run the search and preview the results to check them.
  • Export the results for evidence, or purge the items.

Purge options are soft delete, which moves items to Recoverable Items, and hard delete, which removes them permanently. A message delivered 45 days ago to 120 mailboxes that Threat Explorer no longer shows can be found and purged with a content search. Take care to test the query on a few mailboxes first, since a broad query can purge legitimate mail. A hold can be placed on mailboxes to preserve content for a legal case.

Roles matter. The user needs eDiscovery permissions, for example the eDiscovery Manager role, to search, and a further permission, Search And Purge, to purge.

Microsoft Graph activity logs

Microsoft Graph activity logs record the HTTP requests made to the Microsoft Graph API in your tenant: which application or user called which endpoint, with the response code and details. They help find an attacker, or a malicious application, using Graph to read mail, list users or change settings. For example, a script making high volume calls to enumerate users stands out here.

Key points:

  • They are not on by default. You enable them with a diagnostic setting in Microsoft Entra, choosing the MicrosoftGraphActivityLogs category and a destination such as a Log Analytics workspace.
  • Once in Log Analytics or Sentinel, you query them with KQL, for example to count requests per application.
  • They need Microsoft Entra ID P1 or P2 to export.
  • Combine them with the sign in logs for the application, and the audit logs, to see the whole story of an application based attack.

Choosing the source

The questionSource
Which mail items did the intruder read in the last 90 days?Purview Audit, MailItemsAccessed
What did the intruder search for in the mailbox?Purview Audit, SearchQueryInitiatedExchange
Remove a message from all mailboxes after 45 daysA content search and purge
Which application called Graph to list all users?Microsoft Graph activity logs
SharePoint activity from 75 days agoA Purview Audit search

A worked scenario

A compromised account sent phishing mail to staff. The analyst searches the Audit log for the user's operations over the past 90 days and finds a new inbox rule, a long run of MailItemsAccessed events and a SearchQueryInitiatedExchange record with the keyword "invoice". She also sees SoftDelete and HardDelete events showing the attacker cleaned up. Threat Explorer no longer shows the first phishing mail, so she runs a content search with the sender and subject, previews the results and purges them. Separately, Graph activity logs, sent to Sentinel by a diagnostic setting, reveal a malicious app making high volume calls to list users.

What to remember for the exam

  • Audit (Standard) keeps 180 days. Advanced hunting keeps 30.
  • MailItemsAccessed shows read mail. SearchQueryInitiatedExchange shows mailbox search terms. CopilotInteraction shows Copilot prompts.
  • The deletion operations are MoveToDeletedItems, SoftDelete and HardDelete. Move records a folder move.
  • Content search with purge removes mail even when Threat Explorer no longer has it, and needs search and purge permissions.
  • Graph activity logs need a diagnostic setting and P1 or P2.
Exam tip

When the incident is older than 30 days, switch from advanced hunting to Purview Audit.

How the exam asks about this

  • "Which audit operation records the keywords typed in a mailbox search box?" SearchQueryInitiatedExchange.
  • "Which audit record lets an analyst see Copilot prompts?" CopilotInteraction.
  • "Where can you see which application called Microsoft Graph?" The Microsoft Graph activity logs.
  • "SharePoint activity from 75 days ago." A Purview Audit search.

Common mistakes

Extending a hunting query's time range. It cannot return expired data.

Purging without previewing. A broad query can remove legitimate mail.

Expecting Graph activity logs by default. Enable them with a diagnostic setting.

Confusing SoftDelete with HardDelete. Soft goes to Recoverable Items, hard purges.

Check yourself

  • How long does Audit (Standard) keep records?

    180 days.

  • Which operation records mail items that were read?

    MailItemsAccessed.

  • How do you start collecting Microsoft Graph activity logs?

    Create a diagnostic setting in Microsoft Entra for the MicrosoftGraphActivityLogs category.

Topic 5 of 5 in Respond to Security Incidents

Test yourself on Respond to Security Incidents

The full Microsoft SC-200 question bank has 650 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Microsoft. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.