Microsoft Purview Audit

Enterprise implementation of Microsoft Purview Audit demonstrating centralized audit logging, Unified Audit Log searches, security investigations, export of audit evidence, and compliance validation across Microsoft 365 workloads.

Microsoft 365
Microsoft Purview
MS-102
Microsoft 365 E5
Enterprise Lab
Microsoft Purview Audit

Enterprise Overview

Microsoft Purview Audit provides a centralised, searchable record of user, administrator, application, and service activities across Microsoft 365 workloads. When a security incident occurs, the Unified Audit Log (UAL) is the primary data source for forensic investigation.

This project documents an enterprise implementation of Microsoft Purview Audit, covering audit configuration verification, targeted audit searches, structured investigation workflow, log export for evidence preservation, and integration with compliance reporting processes.

Tenant

securem365lsb.onmicrosoft.com

Audit Tier

Audit Standard

Investigation Scenario

Insider Threat — File Access Pattern Analysis

Business Problem

ChallengeBusiness Impact
No visibility into who accessed sensitive SharePoint documentsUnable to investigate potential data exfiltration
File deletions occur with no accountability recordSecurity team cannot determine scope of data loss
Privileged account actions not reviewed systematicallyCompliance gap for administrator accountability
Security incidents investigated reactively, without dataMean time to investigate (MTTI) is days, not hours
Regulatory auditors require evidence of monitoring controlsFailed audits, potential fines, remediation costs

Business Requirements

  • Audit Trail — every user and administrator action across M365 workloads must generate a searchable audit record
  • Targeted Search — security team must be able to search by user, date range, workload, and activity type
  • Investigation Workflow — structured process for investigating file access, deletion, sharing, and admin changes
  • Evidence Export — audit results must be exportable to CSV for legal hold and forensic reporting
  • Compliance Reporting — audit data must support regulatory requirements (ISO 27001, GDPR Article 5)
  • Retention — audit records retained for a minimum of 90 days (Audit Standard)

Microsoft Solution

Business RequirementMicrosoft Purview Component
Centralised activity loggingUnified Audit Log
Targeted investigation searchAudit Search (date, user, activity, workload filters)
Granular filteringActivity Filters (file, mailbox, Teams, admin events)
Evidence preservationExport to CSV with AuditData JSON
Standard retention & searchAudit Standard (90-day retention, E3/E5)
Extended retention & high-value eventsAudit Premium (1–10 year retention, E5)

Lab Environment

PropertyValue
TenantMicrosoft 365 E5 Trial (securem365lsb.onmicrosoft.com)
Portalcompliance.microsoft.com
Test Accounttestuser1@securem365lsb.onmicrosoft.com
Investigation Period2026-07-01 to 2026-07-03
Activity InvestigatedFileAccessed (SharePoint Online)
Total Events Found12 audit records

Solution Architecture

Microsoft 365 Activity Sources
│
├── Exchange Online
├── SharePoint Online
├── OneDrive
├── Microsoft Teams
└── Entra ID
        │
        ▼
Unified Audit Log (compliance.microsoft.com)
├── 90-day retention (Audit Standard)
├── 1–10 year retention (Audit Premium)
└── Record Types: SharePoint, Exchange, AzureAD, Teams, OneDrive
        │
        ▼
Investigation Tools
├── Audit Search (date / user / activity filters)
├── Results Review (activity, user, IP, workload)
├── CSV Export (evidence preservation)
└── PowerShell Automation

Implementation Phases

Phase 1 — Enable Microsoft Purview Audit

Verified audit is enabled for the tenant at compliance.microsoft.com → Solutions → Audit, and confirmed all workloads appear in the audit solution.

Phase 2 — Configure Audit Search

Configured search parameters including date range, activity type (FileAccessed

Phase 2 — Configure Audit Search

Configured search parameters including date range, activity type (FileAccessed), user (testuser1), and record type (SharePointFileOperation).

Phase 3 — Execute Audit Search

Submitted the search and monitored asynchronous progress as the Unified Audit Log was queried across all storage partitions, returning 12 audit records.

Phase 4 — Investigate User Activities

Reviewed returned audit events including date, user, activity, record type, IP address, and affected files, identifying a pattern consistent with data reconnaissance.

Phase 5 — Export Audit Results

Exported the full CSV of matching audit events, preserving complete AuditData JSON for forensic context and compliance evidence.

Phase 6 — Validation

Opened the exported CSV in Excel to verify completeness and accuracy, confirming all 12 events with full audit context.

Implementation Screenshots

Validation Results

Test CaseDescriptionResult
TC-AUD-01Audit solution accessible at compliance.microsoft.com → Solutions → Audit✅ Pass
TC-AUD-02Audit search executes with date, user, and activity filters✅ Pass
TC-AUD-03Search completes with 12 results for testuser1 FileAccessed✅ Pass
TC-AUD-04Audit results display Activity, User, IP, Date, RecordType fields✅ Pass
TC-AUD-05Export completes and CSV downloads successfully✅ Pass
TC-AUD-06CSV validates in Excel with all 12 records and AuditData JSON intact✅ Pass

PowerShell Automation

Search-UnifiedAuditLog.ps1

Targeted audit log search with activity, user, and date filters.

Export-AuditLogs.ps1

Bulk audit export to CSV and JSON with retention-aware batching.

Get-AuditConfiguration.ps1

Audits configuration — enabled status, mailboxes, admin roles.

Connect-IPPSSession

.\scripts\Search-UnifiedAuditLog.ps1 `
  -StartDate "2026-07-01" `
  -EndDate "2026-07-03" `
  -UserIds "testuser1@securem365lsb.onmicrosoft.com" `
  -Operations "FileAccessed" `
  -OutputPath "C:\AuditExports"

Audit Standard vs Audit Premium

FeatureAudit StandardAudit Premium
Audit Search
Export to CSV
Retention90 days1–10 years
High-Value EventsLimitedEnhanced (MailItemsAccessed, Send)
Advanced Investigation
LicensingE3 / E5E5 / Compliance Add-On

Lessons Learned

  • Audit is enabled by default, but verify before an incident occurs since many organizations assume it is active without checking.
  • Search scope determines performance — targeted searches return results faster than broad date ranges across all users.
  • AuditData JSON is the forensic record; CSV columns are metadata while the JSON field holds the full activity context.
  • Export early — Audit Standard retains logs for only 90 days, so evidence should be preserved immediately.
  • Audit Premium is required for mailbox reads, since MailItemsAccessed is a Premium-only event.

Troubleshooting

IssueLikely CauseResolution
Audit solution not visibleMissing roleAssign Audit Logs or View-Only Audit Logs role
Search returns no resultsAudit not enabledRun Get-AdminAuditLogConfig to verify
Events missing for a userUser excluded from auditCheck per-user audit settings in Exchange
Export fails silentlyPermissions issueVerify Compliance Administrator or eDiscovery roles
Search times outOverly broad scopeNarrow date range or add user/activity filters

Future Improvements

  • Configure Audit Premium for extended retention and MailItemsAccessed events
  • Create scheduled PowerShell jobs for weekly audit log export
  • Build Power BI dashboard connected to exported audit CSV
  • Integrate audit alerts with Microsoft Sentinel for real-time incident creation
  • Configure audit retention policies for specific record types
  • Implement audit log archival to Azure Blob Storage for long-term compliance

GitHub Repository

This repository documents an enterprise Microsoft Purview Audit implementation performed in a Microsoft 365 E5 lab tenant.

View Repository on GitHub