Lesson 151 — The User Downloaded 4 GB of Data Before Resigning
Module 12 ended with an attacker moving from an endpoint toward another device. Module 13 changes the investigation completely.
There is no obvious malware alert. No encoded PowerShell command. No suspicious process tree. Instead, a user resigns — and shortly beforehand their Microsoft 365 activity shows an unusually large volume of SharePoint and OneDrive downloads. In this lesson we use KQL to determine what happened, whether the activity was genuinely unusual and what the evidence can defend.

Your case file
HR advises that alex.wilson@contoso.com resigned at 4:30 PM. Security then notices a sharp increase in SharePoint and OneDrive download activity during the preceding hours.
Case briefing
Investigation objective
Use Microsoft 365 audit data in Microsoft Sentinel to reconstruct SharePoint and OneDrive download activity, quantify the user's behaviour, compare it with an historical baseline and determine whether the sequence warrants escalation as a possible insider-risk or data-exfiltration investigation.
Investigator's rule
Unusual is not the same as malicious. A departing employee may legitimately download files for handover, offline work or an approved business process. Establish the behaviour first; intent requires additional evidence.
Stage 1 — reconstruct the user's cloud download activity
Start with the user and the relevant Microsoft 365 workloads. Preserve timestamps, operations, file names, sites, client IP and user-agent context.
let TargetUser = "alex.wilson@contoso.com";
OfficeActivity
| where TimeGenerated > ago(7d)
| where UserId =~ TargetUser
| where OfficeWorkload in ("SharePoint", "OneDrive")
| where Operation in ("FileDownloaded", "FileSyncDownloadedFull")
| project TimeGenerated,
UserId,
OfficeWorkload,
Operation,
Site_Url,
SourceFileName,
SourceRelativeUrl,
ClientIP,
UserAgent
| order by TimeGenerated ascWhy start with OfficeActivity?
When Microsoft 365 audit data is connected to Sentinel, OfficeActivity can provide a useful investigation view of SharePoint and OneDrive operations. The exact fields available can vary with the workload and event type.
Preserve the operation
FileDownloaded and sync-related operations can represent different user behaviours. Do not collapse them into one story before checking what each event means in your environment.
Stage 2 — quantify the download volume
The initial report says “about 4 GB.” Test that claim against the telemetry. Where your audit records expose a usable file-size field, convert it safely and calculate the total.
let TargetUser = "alex.wilson@contoso.com";
OfficeActivity
| where TimeGenerated > ago(7d)
| where UserId =~ TargetUser
| where OfficeWorkload in ("SharePoint", "OneDrive")
| where Operation in ("FileDownloaded", "FileSyncDownloadedFull")
| extend DownloadBytes = tolong(column_ifexists("FileSize", 0))
| summarize FilesDownloaded=count(),
TotalBytes=sum(DownloadBytes),
Sites=dcount(Site_Url),
FirstDownload=min(TimeGenerated),
LastDownload=max(TimeGenerated)
by UserId
| extend TotalGB = round(TotalBytes / 1024.0 / 1024.0 / 1024.0, 2)Schema matters
Microsoft 365 audit records are not identical across every operation. This query uses column_ifexists() defensively because a file-size field may not be populated in every event. Validate the schema in your tenant before treating the byte total as complete.
Count files as well as bytes
Volume tells one part of the story. File count, number of sites, duration and concentration of activity can reveal whether the behaviour was a small number of large files or a broad collection of organisational data.
Stage 3 — establish the user's normal download baseline
Now step away from the incident day. Look at the preceding 30-day period and calculate the user's normal daily download count.
let TargetUser = "alex.wilson@contoso.com";
OfficeActivity
| where TimeGenerated between (ago(37d) .. ago(7d))
| where UserId =~ TargetUser
| where OfficeWorkload in ("SharePoint", "OneDrive")
| where Operation in ("FileDownloaded", "FileSyncDownloadedFull")
| summarize DailyDownloads=count() by bin(TimeGenerated, 1d)
| summarize BaselineDays=count(),
AverageDailyDownloads=round(avg(DailyDownloads), 1),
MaximumDailyDownloads=max(DailyDownloads),
MinimumDailyDownloads=min(DailyDownloads)Why exclude the incident week?
A baseline should not be contaminated by the activity you are trying to evaluate. Here we deliberately use an earlier historical window to provide cleaner behavioural context.
Baseline is context, not guilt
If the user normally downloads 20 files per day and suddenly downloads 900, the deviation is important. It still does not tell us why the user did it.
Stage 4 — investigate where the downloads came from
Group the activity by client IP, user agent and SharePoint site. This helps determine whether the downloads came from familiar access patterns or a new source.
let TargetUser = "alex.wilson@contoso.com";
OfficeActivity
| where TimeGenerated > ago(7d)
| where UserId =~ TargetUser
| where OfficeWorkload in ("SharePoint", "OneDrive")
| where Operation in ("FileDownloaded", "FileSyncDownloadedFull")
| summarize Downloads=count(),
FirstSeen=min(TimeGenerated),
LastSeen=max(TimeGenerated),
Files=make_set(SourceFileName, 50)
by ClientIP, UserAgent, Site_Url
| order by Downloads descKnown source can still matter
A corporate IP or familiar browser does not make bulk downloading harmless. Insider activity often uses legitimate credentials from legitimate devices.
New source changes the investigation
An unfamiliar IP, user agent or access method can increase concern and may justify correlation with Entra sign-in telemetry, device evidence and Conditional Access results.
Stage 5 — build the resignation-day timeline
Finally, place file access, downloads and sharing-related operations around the known resignation time. Chronology helps distinguish ordinary working activity from a concentrated departure sequence.
let TargetUser = "alex.wilson@contoso.com";
let ResignationTime = datetime(2026-08-18 16:30:00);
OfficeActivity
| where TimeGenerated between (ResignationTime - 24h .. ResignationTime + 1h)
| where UserId =~ TargetUser
| where OfficeWorkload in ("SharePoint", "OneDrive")
| where Operation in ("FileAccessed", "FileDownloaded", "FileSyncDownloadedFull",
"SharingSet", "AnonymousLinkCreated")
| project TimeGenerated,
Operation,
OfficeWorkload,
Site_Url,
SourceFileName,
SourceRelativeUrl,
ClientIP,
UserAgent
| order by TimeGenerated ascLook beyond downloads
File access followed by downloads, external sharing or anonymous-link creation can materially change the risk assessment. Follow the evidence into the operations that surround the bulk activity.
HR context is not telemetry
The resignation time is business context supplied to the investigation. Keep it distinct from the Microsoft 365 events so the final report clearly separates organisational facts from technical evidence.
Agent Foskett's cloud activity timeline
Your evidence board
| Evidence | What it supports | Weight |
|---|---|---|
| Large volume of SharePoint and OneDrive downloads | Establishes unusual data collection when validated against the audit schema. | Strong behavioural evidence |
| Activity materially exceeds the user's historical baseline | Supports the conclusion that the behaviour was abnormal for this user. | Strong context |
| Downloads concentrated shortly before resignation | Creates a significant temporal relationship with the departure event. | Strong context |
| Unfamiliar IP or user agent | May suggest a different access source and warrants identity correlation. | Strong when validated |
| Known corporate device or IP | Shows the source may be legitimate infrastructure. | Does not remove risk |
| Resignation plus 4 GB alone | Does not prove theft, malicious intent or unauthorised disclosure. | Insufficient alone |
Write the finding like an investigator
Example: Microsoft 365 audit telemetry recorded a substantial increase in SharePoint and OneDrive download activity by alex.wilson@contoso.com during the period immediately preceding the user's resignation. The activity was reviewed by timestamp, workload, file operation, site, client IP and user-agent context and compared with an earlier behavioural baseline. The incident-day download pattern materially exceeded the user's recent normal activity and was concentrated within the hours before the recorded resignation time. This supports escalation as unusual pre-departure data collection. The available evidence does not, by itself, establish malicious intent, unauthorised disclosure or successful exfiltration outside the organisation. Further investigation should review the sensitivity of the files, external sharing activity, endpoint evidence, identity telemetry and applicable HR or legal context.
Lesson 151 key takeaways
- Large download volume should be measured and validated rather than accepted from an initial alert or report.
OfficeActivitycan support SharePoint and OneDrive investigations when Microsoft 365 audit data is available in Sentinel.- Audit schemas can vary by operation, so validate fields before relying on calculated byte totals.
- Preserve file, site, IP, user-agent and operation context.
- Historical behaviour helps distinguish routine downloading from a genuine anomaly.
- A baseline identifies abnormality; it does not establish intent.
- Known devices and corporate IPs do not automatically make bulk data collection legitimate.
- Correlate download activity with sharing operations and identity telemetry.
- Keep HR facts separate from technical telemetry in the final report.
- Write the conclusion at exactly the strength the evidence supports.
Module 13 has begun
Lesson 151 opens a new investigation path. Instead of following malware across an endpoint, Module 13 follows users, sessions and applications through Microsoft 365 and cloud services. Next, the same account appears to access SharePoint from two different countries.
Continue your KQL investigation training
Related Agent Foskett Investigations
🔎 KQL Academy — Module 13: Advanced Cloud & SaaS Investigation
Investigate SharePoint and OneDrive downloads with KQL
Lesson 151 of the Agent Foskett KQL Academy uses Microsoft Sentinel and Microsoft 365 audit data to investigate unusually large SharePoint and OneDrive download activity before a user resigns.
Use KQL to investigate possible Microsoft 365 data exfiltration
Learn how to reconstruct file-download activity, quantify cloud data collection, establish a historical baseline, review source context and write a defensible insider-risk investigation finding without assuming malicious intent.
