Home
Enabling Exchange Online Mailbox Auditing
Published: Tuesday, 28 November 2017 | Categories: Office 365 | Keywords: Auditing | Status: Posted | Created: Tuesday, 28 November 2017 | Author: paul

Exchange Online mailbox auditing is off by default. Use following powershell script to enable across all mailboxes.


# Enable Auditing on all Mailboxes

$Cred = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $Cred -Authentication Basic -AllowRedirection

Import-PSSession $Session

# Enable Auditing for User Mailboxes

Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox"} | Set-Mailbox -AuditEnabled $true

# Owner not audited by default so set that

Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "UserMailbox"} | Set-Mailbox -AuditOwner MailboxLogin,HardDelete,SoftDelete

# Enable Auditing for Shared Mailboxes

Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "SharedMailbox"} | Set-Mailbox -AuditEnabled $true

# Owner not audited by default so set that

Get-Mailbox -ResultSize Unlimited -Filter {RecipientTypeDetails -eq "SharedMailbox"} | Set-Mailbox -AuditOwner MailboxLogin,HardDelete,SoftDelete

 
Need to log into Office 365 as user with Exchange Admin access.

Add Comment
No Comments.