When it is written
SharePoint writes SharingPolicyChanged when a SharePoint or global admin changes the sharing policy in the Microsoft 365 admin center, the SharePoint admin center or SharePoint Management Shell. Microsoft states that any change to the sharing policy settings is logged, and that the record identifies the policy that changed in ModifiedProperties.
The organization-level settings decide how far files can go for every site and every OneDrive: the external sharing level (Anyone links, new and existing guests, existing guests, or only people in the organization), the allowed or blocked domains, who may share externally, guest access expiry, and the default link type and expiry of Anyone links. A site can be set more restrictive than the organization, never more open. Microsoft notes that turning external sharing off and back on gives guests their access back, and that restricting it removes guest access within about an hour.
The record says the setting changed; it does not show sharing. Links and invitations created afterwards are separate sharing records.
How to turn it on
Microsoft 365 unified audit log (SharePoint and OneDrive) records SharingPolicyChanged calls to Microsoft 365 unified audit log (SharePoint and OneDrive) without any setup. Vendor documentation
SharePoint and OneDrive activity is recorded in the Microsoft 365 unified audit log by Microsoft Purview Audit (Standard), which is on by default for most organizations. Microsoft names two exceptions where auditing must be turned on by hand: tenants with Business Basic, Business Standard or Business Premium licences, and unmanaged tenants on enterprise trials. Check UnifiedAuditLogIngestionEnabled in Exchange Online PowerShell (in Security & Compliance PowerShell the property always reads False). After auditing is turned on, records can take several hours to become searchable.
- Retention follows the licence of the user who performed the activity: 180 days with Audit (Standard) (90 days for records created before 17 October 2023). With Audit (Premium) (E5, or an E5 Compliance or eDiscovery and Audit add-on) a default policy keeps SharePoint and OneDrive records one year; records of users without such a licence stay 180 days. Ten years needs a separate add-on licence and a retention policy.
- Collection: the Office 365 Management Activity API publishes SharePoint and OneDrive records in the
Audit.SharePointcontent type. A subscription has to be started first (the first content can take up to 12 hours), content can be listed at most 7 days back, and records do not arrive in the order they happened. Microsoft Sentinel's Microsoft 365 data connector with SharePoint selected writes them to theOfficeActivitytable. - Delay: Microsoft guarantees no delivery time. For SharePoint and OneDrive, records are typically available 60 to 90 minutes after the activity.
- Turning auditing off (
Set-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $false) also stops the Management Activity API and Sentinel collection; the change is itself recorded as aSet-AdminAuditLogConfigrecord in the Exchange admin records.
Get-AdminAuditLogConfig | Format-List UnifiedAuditLogIngestionEnabledGet-UnifiedAuditLogRetentionPolicy | Sort-Object -Property Priority -Descending | Format-List Priority,Name,RecordTypes,Operations,UserIds,RetentionDurationInvoke-RestMethod -Method Get -Uri "https://manage.office.com/api/v1.0/<tenant-id>/activity/feed/subscriptions/list" -Headers @{ Authorization = "Bearer <access-token>" }Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-7) -EndDate (Get-Date) -Operations SharingPolicyChanged -ResultSize 5 | Select-Object -ExpandProperty AuditDataFields
The operation’s own fields first, then the fields every Microsoft 365 unified audit log (SharePoint and OneDrive) record has. Field names are the JSON paths of the record as the vendor documents it.
| Field | What it holds |
|---|---|
ModifiedProperties | The settings that changed, each with its name (Name), new value (NewValue) and previous value (OldValue). Microsoft documents that this record names the changed policy here but does not list the property names it uses. |
Fields every Microsoft 365 unified audit log (SharePoint and OneDrive) record has (21)
| Field | What it holds |
|---|---|
CreationTime | When the record was generated, in UTC. |
Id | Unique identifier of the audit record. |
OperationRead by 1 rule | The user or admin activity. The operation this page is about. |
RecordType | The kind of record (4 SharePoint for site and admin events, 6 SharePointFileOperation for file and page events, 14 SharePointSharingOperation for sharing, 36 SharePointListOperation for lists). |
Workload | The Microsoft 365 service the activity happened in, SharePoint or OneDrive. |
OrganizationId | GUID of the Microsoft 365 tenant, the same in every service. |
UserId | UPN of the user who performed the activity. System accounts such as SHAREPOINT\system appear too, and app@sharepoint means an application with SharePoint app-only access acted for a user, an admin or a service. |
UserKey | An alternative ID for the user in UserId (the passport unique ID, PUID, for SharePoint and OneDrive users). |
UserType | Who performed the activity (0 Regular, 2 Admin, 3 DCAdmin, 4 System, 5 Application, 6 ServicePrincipal, 9 PartnerTechnician, 10 Guest...). |
ClientIP | Address of the device used for the activity. For some services it is the address of an application, such as Office on the web, acting for the user. |
ObjectId | For SharePoint and OneDrive activity, the full URL of the file or folder the activity was about. Microsoft does not say what it holds for a site-level event; expect the site address there, and check it on a record of your own. |
ResultStatus | Whether the activity succeeded (Succeeded, PartiallySucceeded or Failed), when the record carries it. |
Version | Version number of the record format for this activity. |
Scope | Where the event was created, online for Microsoft 365 or onprem for an on-premises server; SharePoint is the only workload that sends on-premises events. |
AppAccessContext | The application context of the user or service principal that acted (ClientAppId, ClientAppName, AADSessionId, CorrelationId, UniqueTokenId, IssuedAtTime), when a Microsoft Entra token was involved. |
Site | GUID of the site the item belongs to. |
ItemType | The type of object the activity was about (File, Folder, Web, Site, Tenant, DocumentLibrary, Page). |
EventSource | Where in SharePoint the event occurred, SharePoint or ObjectModel. |
UserAgent | The user's client or browser, as the client reports it. |
ApplicationId | ID of the application that performed the activity, when an application did. |
ApplicationDisplayName | Display name of that application; with app@sharepoint it helps tell which task produced the record. |
Values to know
ModifiedProperties
| Value | Meaning | Signal |
|---|---|---|
a new value that opens sharing (Anyone links, new guests, fewer domain or group limits) | Files can now go further outside the organizationThe change the rule exists for. Confirm a change record; otherwise restore the previous value and look for links and invitations created since. | Attack signal |
a new value that narrows sharing | The organization tightened sharingStill worth a glance at who made it; guests lose access within about an hour. | Noise |
Volume and noise
Low in most tenants: the organization sharing settings change when a collaboration project starts, a partner domain is added, or a security review tightens them. The rule fires on every change, tightening included, so the record has to be read. A change that widens external sharing (to Anyone links or new guests, a removed domain restriction, a longer link expiry), made by an account that does not normally administer SharePoint or without a change record, is the one to read first.
Keeping it manageable
- Read each entry of
ModifiedPropertiesand decide whether the new value opens or closes sharing; alert at a higher severity on changes that open it. - Compare the tenant with its intended values after a change.
Get-SPOTenant(SharePoint Online PowerShell, read only) returns the organization settings thatSet-SPOTenantsets, such asSharingCapability. - List the accounts that are expected to change SharePoint settings and review changes by others first.
- Look for sharing activity right after a change that opened sharing, such as new Anyone links or guest invitations.
Sample event
A Microsoft 365 unified audit log (SharePoint and OneDrive) record in the vendor’s format, with made-up values.
{
"CreationTime": "2026-11-18T09:30:12",
"Id": "6f1c2d3e-4a5b-4c6d-8e9f-0a1b2c3d4e5f",
"Operation": "SharingPolicyChanged",
"OrganizationId": "00000000-0000-0000-0000-00000000c0de",
"RecordType": 4,
"UserKey": "10032001A2B3C4D5",
"UserType": 2,
"Version": 1,
"Workload": "SharePoint",
"ClientIP": "203.0.113.24",
"ObjectId": "https://corpexample-admin.sharepoint.com/",
"UserId": "sp-admin@corp.example.com",
"AppAccessContext": {
"AADSessionId": "00000000-0000-0000-0000-00000000a5e5",
"CorrelationId": "00000000-0000-0000-0000-0000000c0aa1"
},
"EventSource": "SharePoint",
"ItemType": "Tenant",
"Site": "00000000-0000-0000-0000-0000000517e1",
"UserAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 Edg/131.0.0.0",
"ModifiedProperties": [
{
"Name": "SharingCapability",
"NewValue": "ExternalUserAndGuestSharing",
"OldValue": "ExistingExternalUserSharingOnly"
}
]
}Attacks this event reveals
Detection rules that read this event:
Frequently asked questions
Does a SharingPolicyChanged record mean files were shared?
No. It records that a setting changed. Sharing links and invitations created afterwards are written as their own sharing records.
Why does the rule fire when sharing is tightened?
Microsoft uses the same operation for every change of the sharing policy. Only ModifiedProperties tells a change that opens sharing from one that closes it.