Skip to content

Instantly share code, notes, and snippets.

@mobernberger
Created March 12, 2020 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mobernberger/6194298bbb2087a0295214e52497c869 to your computer and use it in GitHub Desktop.
Save mobernberger/6194298bbb2087a0295214e52497c869 to your computer and use it in GitHub Desktop.
#Connect to Exchange Online Powershell before running this commands.
$Mbx = Get-Mailbox -RecipientTypeDetails UserMailbox, SharedMailbox -ResultSize Unlimited | Select DistinguishedName, DisplayName
ForEach ($M in $Mbx) {
Write-Host "Manually enabling mailbox auditing for" $M.DisplayName
Set-Mailbox -Identity $M.DistinguishedName -AuditEnabled $True }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment