Enable Exchange Online Mailbox Auditing for Shared and Resource Mailboxes
Question details
Enable mailbox auditing for user, shared, room, and equipment mailboxes so they can be assessed for compliance.

- Product
- Microsoft Exchange Online and Microsoft Secure Score
- Device & OS
- not provided
- Scenario
- An administrator uses an Exchange Online PowerShell script to enable mailbox auditing for a Microsoft 365 organization.
- Observed behavior
- Secure Score reports that only some mailboxes have auditing enabled because the script targets user mailboxes and excludes shared and resource mailboxes.
Sign in with an account that has permission to manage Exchange Online mailboxes, and ensure the Exchange Online PowerShell module is available. Review the mailbox types and any existing auditing requirements before applying changes across the organization.
Enable auditing across Exchange Online mailboxes
Use this approach when all returned mailboxes should have auditing enabled, including shared, room, and equipment mailboxes.
The original script filters for UserMailbox, so it does not update shared or resource mailboxes. Removing that filter applies the setting to all mailboxes returned by Get-Mailbox.
Open PowerShell, run Connect-ExchangeOnline, and sign in with an authorized administrator account.
Run Get-Mailbox -ResultSize Unlimited | Set-Mailbox -AuditEnabled $true. This changes the auditing setting for all mailboxes returned by the command.
Run Get-Mailbox -ResultSize Unlimited | Select-Object DisplayName,RecipientTypeDetails,AuditEnabled to review the mailbox types and confirm that AuditEnabled is True.
Return to the Microsoft Secure Score portal and review the mailbox auditing recommendation after its assessment has refreshed.

Enable auditing for selected mailbox types
Use this approach when you want to change user, shared, room, and equipment mailboxes without updating other returned mailbox types.
Document Exchange Online Audit Reviews with WPS Office
WPS Office is a free, lightweight alternative for preparing audit documentation and reviewing exported reports. Its familiar interface and Microsoft Office format compatibility make it easy to move existing documents and spreadsheets. Exchange Online mailbox settings must still be managed in Microsoft 365.

Frequently Asked Questions
Why did the original script skip shared and resource mailboxes?
Its RecipientTypeDetails filter specifies UserMailbox, so shared, room, and equipment mailboxes do not match. Remove the filter to target all returned mailboxes, or explicitly select the required mailbox types.
How can I find mailboxes with auditing disabled?
In Exchange Online PowerShell, run Get-Mailbox -ResultSize Unlimited | Where-Object {$_.AuditEnabled -eq $false} | Select-Object DisplayName,RecipientTypeDetails,AuditEnabled.
Does enabling auditing also set the audit log retention period?
No. The AuditEnabled setting does not change AuditLogAgeLimit. Review your organization's retention requirements separately before changing that setting.
Why has Secure Score not updated after I enabled auditing?
The assessment may need time to refresh. Verify AuditEnabled in Exchange Online PowerShell and check the organization-wide AuditDisabled setting, then review the recommendation again after the next assessment.




