Microsoft 365 is more than just email and document editing—it’s a full productivity ecosystem integrating Exchange Online, SharePoint, OneDrive, Teams, and Azure Active Directory. While these tools provide powerful collaboration capabilities, they also introduce security and compliance responsibilities.
One of the most critical responsibilities for IT administrators is audit logging. Whether it’s for security investigations, regulatory compliance, insider threat detection, or eDiscovery, audit logs are indispensable. Unfortunately, many organizations either leave auditing off, misconfigure it, or under-utilize its capabilities, leaving them blind to important events in their environment.
This guide dives deep into Microsoft 365 audit logging: how to enable it, search and analyze logs, export data, and adopt best practices to maintain visibility and security.
Understanding Microsoft 365 Audit Logs
Unified Audit Log
The Unified Audit Log (UAL) aggregates audit events from multiple Microsoft 365 services: Exchange, SharePoint, OneDrive, Teams, Power BI, and Azure AD. It provides a central location for searching and analyzing events, avoiding the need to manually query each service individually.
Retention & Licensing
The retention period for audit logs depends on your Microsoft 365 license:
- E3 / Business Premium: Typically 90 days of retention
- E5: Extended retention (up to 1 year or more) and additional auditing features
Knowing your license limits is crucial when designing your audit strategy.
Permissions
Only users with appropriate roles can manage and view audit logs. Common roles include:
- Compliance Administrator
- Security Administrator
- Audit Logs or View‑Only Audit Logs
Always enforce least privilege to reduce exposure to sensitive audit data.
Preparing to Enable Audit Logging
Before you enable audit logging, consider the following:
- Admin Permissions: Ensure your account has the necessary roles to configure auditing.
- Licensing: Verify your Microsoft 365 plan supports the retention and features you need.
- Scope & Objectives: Decide which services to monitor (Exchange, SharePoint, Teams) and the purpose (security, compliance, HR). A well-defined scope prevents log overload.
Real-world tip: Without a clear plan, many organizations capture every possible event, creating massive logs that are difficult to analyze and store.
How to Enable Microsoft 365 Audit Logging
Using the Compliance Center
- Sign in to Microsoft 365 Compliance (or Security & Compliance Center).
- Navigate to Search & Investigation → Audit log search.
- If not already enabled, click Turn on auditing.
This starts ingestion of audit data across supported services.
Using PowerShell
For automation or multi-tenant environments, PowerShell is efficient:
Connect-ExchangeOnline -UserPrincipalName [email protected]
Set-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $true
Note: Some services, like Teams or Power BI, may require additional logging configurations.
Searching the Audit Log
Once auditing is enabled and logs have ingested (typically a few hours delay), you can search logs via the Compliance portal.
Key Search Parameters
- Activities: e.g., file access, mailbox rule changes, admin role changes
- Date Range: Narrow to the relevant period for better performance
- Users: Target specific individuals, groups, or all users
- Location / Object: Target specific mailboxes, SharePoint sites, or files
Additional filters include IP addresses, client applications, and keywords.
Pro Tip: For large organizations, break searches into smaller date ranges to avoid UI limits (often 5,000 results).
Exporting and Analyzing Audit Logs
Exporting Results
Filtered results can be exported to CSV for further analysis, supporting:
- Bulk reporting
- Security investigations
- Regulatory submissions
Parsing AuditData
The exported CSV often contains a column called AuditData in JSON format. Use tools like Excel Power Query, PowerShell, or SIEM solutions to convert JSON into readable columns, including user, IP address, timestamp, and object modified.
Storage & Retention
Store exported audit logs securely, using encrypted, versioned repositories. For compliance, some organizations retain logs beyond Microsoft 365 default retention using external archival solutions.
Best Practices for Microsoft 365 Audit Logging
| Best Practice | Why It Matters |
|---|---|
| Enable auditing immediately | Avoids gaps in history; critical for new tenants |
| Restrict permissions | Only necessary personnel should access sensitive logs |
| Tailor what to audit | Prevents log overload; focus on high-value events |
| Proactive monitoring | Set alerts for mass deletions, suspicious logins, or elevated privileges |
| Align retention with compliance | Meet legal or regulatory requirements |
| Test regularly | Simulate events to confirm logs are captured correctly |
Common Pitfalls
- Assuming audit logging is automatically enabled for all services
- Ignoring service-specific audit settings (Teams, Power BI)
- Overlooking retention limitations of your license
- Misinterpreting AuditData without parsing JSON
- Failing to restrict access to logs
Troubleshooting Tips
- No entries after enabling: Wait a few hours for ingestion; verify service coverage and permissions
- Search capped at 5,000 items: Refine date range or filter by activity/user
- JSON parsing issues: Use Power Query in Excel or a SIEM tool for structured analysis
- Missing events: Verify the activity is supported by Microsoft’s unified audit logs
Real-World Use Cases
- Suspicious Login Investigation: Identify unusual IP addresses or login times indicating potential compromise.
- Unauthorized File Deletion: Audit SharePoint/OneDrive deletions for recovery and accountability.
- Email Forwarding Rules: Detect insider threats by monitoring mailbox rule changes.
- Admin Changes: Track privilege escalations, password policy modifications, or MFA changes.
Experience shows that combining audit logs with conditional access reports and security alerts is the most effective method to spot security risks early.
Compliance Considerations
- Retention Limits: Check your license tier (E3 vs E5) for retention capability.
- Regulatory Requirements: Industries such as finance or healthcare may require multi-year log retention.
- Data Privacy: Audit logs contain sensitive info (usernames, IPs, document paths). Ensure encryption and controlled access.
Conclusion
Microsoft 365 audit logs are essential for IT security, compliance, and operational oversight. Enabling unified auditing, structuring searches effectively, exporting for analysis, and adhering to best practices provides administrators with unmatched visibility.
Start early, define what matters most, and make auditing part of your ongoing operational strategy. With these practices, you ensure security, regulatory compliance, and operational transparency across your Microsoft 365 environment.
In a world of growing cyber threats and regulatory scrutiny, a robust audit log strategy is not optional—it’s a cornerstone of modern IT governance.

From my early days on the helpdesk through roles as a service desk manager, systems administrator, and network engineer, I’ve spent more than 25 years in the IT world. As I transition into cyber security, my goal is to make tech a little less confusing by sharing what I’ve learned and helping others wherever I can.
