Skip to main content
KBY Technologies Logo

Finding Who Changed an Exchange Online Setting with the Microsoft 365 Audit Log

Search the Microsoft 365 audit log for Exchange Online changes read-only, read the cmdlet, object and account in AuditData, and know what a record cannot prove.

KBY Technologies12 min readFoundation13 min
Finding Who Changed an Exchange Online Setting with the Microsoft 365 Audit Log

Before you begin

  • A Microsoft 365 tenant you are allowed to inspect, ideally a training or test tenant.
  • An account with the View-Only Audit Logs or Audit Logs role.
  • The ExchangeOnlineManagement PowerShell module and a text editor.

Underlined words are defined in the KBY Lexicon. Tap or click one to see what it means.

When a mail flow rule, a mailbox setting or an organisation-wide option changes and nobody admits to it, the answer is often already written down. records changes made in in its audit log, and that record names the person or account, the cmdlet that ran and the object it touched. Reading it is a skill every junior administrator needs, because it turns “something changed” into evidence.

The log shows who ran a change and what the change was. It does not show why, and it cannot tell you whether the change was a mistake. Keeping those two things apart is the habit to build, using a read-only search that changes nothing in the tenant.

#By the end you can

  • Check that audit log search is turned on for your organisation, without changing the setting.
  • Explain which Exchange Online actions reach the Exchange admin audit log and which never do.
  • Search for Exchange admin records by date range with Search-UnifiedAuditLog and read the result.
  • Pick out the cmdlet, the changed object, the parameters and the outcome from a record’s AuditData.
  • Say what a record proves, what it only suggests and when to escalate.

#Before you begin

  • A Microsoft 365 tenant you are allowed to inspect, ideally a training or test tenant rather than a production one.
  • An account that holds the View-Only Audit Logs or Audit Logs role. In the Microsoft Purview portal, the Audit Reader role group grants the first and the Audit Manager role group grants both. To use the audit cmdlets you also need the same role in the Exchange admin center.
  • The ExchangeOnlineManagement PowerShell module, which provides Connect-ExchangeOnline, and a text editor for your notes.

Ask for the Audit Reader role if you can. It lets you search and export the log but not turn auditing on or off, which is all this exercise needs and the least access that does the job.

#What gets recorded, and for how long

When a user or admin performs an audited activity, Microsoft 365 writes an audit record and stores it in your organisation’s audit log. The log holds events from Exchange Online, SharePoint, OneDrive, , Microsoft Teams and other services in one place, which is why it is called the unified audit log. Audit log search is on by default for Microsoft 365 and Office 365 enterprise organisations.

Exchange has its own part of the log. Exchange administrator audit logging, which Microsoft 365 enables by default, records an event when an administrator, or a user with administrative permissions, makes a change in your Exchange Online organisation. It covers changes made in the Exchange admin center and cmdlets run in Exchange Online PowerShell. In these records the Operation property holds the name of the cmdlet that ran.

Three limits shape every investigation. Each one decides whether a missing record means “nothing happened” or only “nothing you can see”.

  • Reads are not logged. The Exchange admin audit log does not record cmdlets that begin with Get-, Search- or Test-. Looking at a setting leaves no record in this log, and only changes do.
  • Some cmdlets are never logged. Microsoft says some Exchange Online cmdlets, many of them service-maintenance ones run by datacentre staff or service accounts, are not audited because they would create too much noise.
  • Records age out and arrive late. Records are kept for 180 days for most licences. Users with an Office 365 E5 or Microsoft 365 E5 licence, or an eligible add-on, have Microsoft Entra ID, Exchange and SharePoint records kept for one year by default. A new Exchange admin record can take up to 30 minutes to appear, and for core services such as Exchange, SharePoint, OneDrive and Teams, records usually appear 60 to 90 minutes after the event, with no guaranteed time.
Person using a laptop with an online communication platform, showcasing modern work tech.
Photo by Mikhail Nilov on Pexels

#
The path from a change to a record you can read

The sequence below is the path every Exchange change takes before you can read it. Each step is a place where a search can come up empty.

#
What one record contains

Each audit record carries a column called AuditData, a JSON object with the detail. For an Exchange admin event, a handful of its properties answer most questions about a change.

Properties of an Exchange admin audit record and the question each answers, from the Microsoft documentation
PropertyWhat it holdsQuestion it answers
CreationTimeWhen the record was generated, in UTCWhen did it happen?
UserIdThe user principal name of the account that performed the actionWho ran it?
OperationThe name of the cmdlet that ranWhat kind of change was it?
ObjectIdThe name of the object the cmdlet modifiedWhat was changed?
ParametersThe name and value of every parameter used with the cmdletWith which settings?
ModifiedPropertiesFor admin events, each changed property with its new and previous valueWhat was it before?
ResultStatusFor Exchange admin activity, True or FalseDid it succeed?
ExternalAccessFalse when someone in your organisation ran it; True when datacentre staff, a service account or a delegated administrator didWas it us, or someone acting from outside?

Not every record carries every property. Microsoft says ModifiedObjectResolvedName is logged only when the cmdlet modifies the object, so an event can lack it. Treat an empty property as “not recorded”, not as “nothing changed”.

#A worked example: the mail flow rule nobody remembers

Suppose a colleague reports that messages to a supplier stopped arriving on Tuesday afternoon, and a transport rule that nobody remembers creating is the prime suspect. This is an invented scenario to show the method, not output from a real tenant. The administrator’s plan has four steps, and none of them changes anything.

  1. Fix the window. Messages stopped after lunch on Tuesday, so search from Tuesday 09:00 to Wednesday 09:00, written in UTC because the log stores times in UTC.
  2. Narrow to the right part of the log. Searching only the ExchangeAdmin record type removes SharePoint, Teams and sign-in noise.
  3. Read the list, then open the interesting record. A Set-, New- or Remove- cmdlet near the time of the first failure is the lead. The ObjectId says which object it touched and Parameters says how.
  4. Write down what the record proves: this account ran this cmdlet on this object at this time, and it succeeded or failed.

Following along? Tap a step’s number to tick it off.

What the record does not prove is intent. The account may belong to a person following a ticket, to a script, or to someone whose credentials were misused.

The next move is to ask the account owner and check the change ticket. Link the finding to the reported symptom only after you have confirmed the timeline. For the mail-delivery side of this scenario, tracing a missing email in Exchange Online with a read-only message trace gives the matching evidence from the other direction.

#Exercise: read your own tenant’s recent Exchange changes

Objective. Search the last seven days of Exchange admin audit records, open one, and answer who, what, which object, which settings, when and whether it worked. Safe setup. Every command below is read-only. Get-AdminAuditLogConfig reads a setting and Search-UnifiedAuditLog reads the log. Do not run the Set-AdminAuditLogConfig cmdlet, which turns audit ingestion on or off.

  1. Connect to Exchange Online PowerShell with Connect-ExchangeOnline -UserPrincipalName <your UPN>.
  2. Check that search is on with Get-AdminAuditLogConfig | Format-List UnifiedAuditLogIngestionEnabled. Run it in Exchange Online PowerShell, because the same cmdlet in Security and Compliance PowerShell always shows False. Write down the value.
  3. Set a window in UTC with $end = (Get-Date).ToUniversalTime() and $start = $end.AddDays(-7).
  4. Search with $records = Search-UnifiedAuditLog -StartDate $start -EndDate $end -RecordType ExchangeAdmin -ResultSize 100.
  5. List what came back with $records | Select-Object CreationDate,UserIds,Operations | Sort-Object CreationDate -Descending | Format-Table and note how many rows there are.
  6. Pick the newest row and read its detail: $detail = ($records | Sort-Object CreationDate -Descending | Select-Object -First 1).AuditData | ConvertFrom-Json, then $detail | Format-List CreationTime,UserId,Operation,ObjectId,ResultStatus,ExternalAccess and $detail.Parameters.
  7. Disconnect with Disconnect-ExchangeOnline.

Expected evidence. Step 2 shows True. Step 5 lists rows whose operations are cmdlet names such as Set- or New- commands, and none that start with Get-, Search- or Test-. Step 6 gives you a time in UTC, an account, a cmdlet, an object name and a list of parameter names and values. If the tenant had no Exchange changes in the window, step 5 returns nothing, which is a valid result.

Pass condition. You can write one sentence in the form “At [time] UTC, [account] ran [cmdlet] on [object] with [parameters], and it [succeeded or failed]”, and a second sentence naming one thing the record does not tell you.

Stop condition. Stop if a command asks you to confirm a change, or if you find yourself about to run a Set- or Remove- cmdlet.

Cleanup. There is nothing to undo, because no setting changed. Disconnect the session, as Microsoft advises, so that you do not use up your available sessions.

Close-up of a laptop showing a messaging app interface with eyeglasses in the foreground.
Photo by Mikhail Nilov on Pexels

#How to check that the search told the truth

A search that returns nothing is weaker evidence than one that returns a record. Before you rely on an empty result, work through these checks.

  • Is auditing on? If UnifiedAuditLogIngestionEnabled is not True in Exchange Online PowerShell, there may be no records to find for the period it was off.
  • Is the window right? Times are UTC. If you use the same date for start and end without a time, the two values are equal and nothing comes back, so give each a time. The longest range the Purview portal accepts is 180 days.
  • Has enough time passed? A change made twenty minutes ago may not be searchable yet.
  • Did you hit the page limit? By default the cmdlet returns up to 100 records, and -ResultSize accepts up to 5,000. For larger sets, Microsoft says to use -SessionCommand ReturnLargeSet, which can return up to 50,000 results but in unsorted order, so sort the output yourself.
  • Can your account see everything? In the Purview portal, an administrator scoped to administrative units sees only logs for users in those units. Microsoft lists Exchange operations such as Set-Mailbox among the activities only unrestricted administrators can reach through search queries.
  • Is the cmdlet audited at all? If the change should have a record and does not, the cmdlet may be one Microsoft does not log.

The Purview portal offers the same data through Audit search. You choose a date range in UTC, record types, users and operation names, and start a search job. Large, broad jobs can take up to 48 hours in big tenants, so a narrow window answers faster. Completed jobs are kept for 30 days, and you can export results to a CSV file.

#What goes wrong when you read the log

  • Searching for a read. Looking for who viewed a setting finds nothing, because Get-, Search- and Test- cmdlets are not recorded in this log.
  • Reading local time as UTC. A change at 14:00 local time in a summer or winter offset lands in a different hour in the log. Convert before you compare with a user’s report.
  • Blaming the account too early. The account shows who ran the cmdlet, not who decided to. Shared, automation and compromised accounts all produce the same record.
  • Trusting a blank property. A record may lack a property, and ModifiedObjectResolvedName appears only when the cmdlet modifies the object. A missing previous value is not evidence that nothing changed.
  • Treating NT AUTHORITY\SYSTEM as an intruder. In some mailbox audit records, especially for Add-MailboxPermissions, the user appears as NT AUTHORITY\SYSTEM or the Exchange admin API service. Microsoft says this system account performs scheduled maintenance on behalf of your organisation.
  • Undoing the change to see what happens. Reverting a setting before you record the evidence can hide a live symptom and blur the timeline. Capture the record first, then follow your change process.

#Taking this into production

In production the method is the same, and the controls around it matter more. Give the people who investigate changes read access to the log through the Audit Reader role group rather than a broad administrator role, and keep the ability to turn auditing off with the few people who own that decision.

If your organisation needs records for longer than the default, ask the person who owns licensing and retention policy about the one-year option and about audit log retention policies.

Treat the audit record as one input to a timeline. Combine it with the change ticket, the user’s report and, for mail problems, a message trace. When the record shows an account you do not recognise, ExternalAccess of True, or a change on an object you do not own, stop investigating alone. Pass the record, your search window and the exact commands you ran to your security contact or the owner of the service.

Giving them the evidence is more useful than a conclusion.

For a related Exchange skill, the guide to creating a shared mailbox in Microsoft 365 and granting Full Access and Send As shows the kind of change that appears in these records.

#What to remember

  • The Exchange admin audit log records changes, not reads: Get-, Search- and Test- cmdlets are not logged.
  • One record answers when, who, what, which object, which settings and whether it succeeded, through CreationTime, UserId, Operation, ObjectId, Parameters and ResultStatus.
  • Search windows are in UTC, results default to 100 records, and records can take up to 30 minutes or more to appear.
  • A record proves that an account ran a cmdlet. It does not prove who decided, or why.
  • Use the lowest role that works, keep the exercise read-only, and escalate with your evidence when something looks wrong.

About this page

Credited to

Dates

Published

Sources

This page lists no external sources.

Corrections

No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.

Found this useful? Follow KBY for more like it.

Reader Interaction

Comments

Add a thoughtful note on Finding Who Changed an Exchange Online Setting with the Microsoft 365 Audit Log. Comments are checked for spam and held for moderation before appearing.

Loading comments...

More from KBY that goes with this article.

Discover more

Was this useful?

Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.

Build practical engineering skills.

Receive new lessons, learning paths, practical exercises and early-career guidance.