Office 365 – Enable audit on user mailbox

Last updated on March 26th, 2018 at 09:44 am

$O365Cred = Get-Credential
$O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $O365Cred -Authentication Basic -AllowRedirection
Import-PSSession $O365Session
Get-Recipient -ResultSize Unlimited | select DisplayName,RecipientType,EmailAddresses | Export-Csv C:\email-recipients.csv
Set-Mailbox -Identity [email protected] -AuditEnabled $true