How to Fix HTTP 401 Error When Running Search-MailboxAuditLog in Microsoft 365
Question details
The user needs to resolve an HTTP 401 Unauthorized error that occurs when attempting to run a mailbox audit log search on a specific shared mailbox.

- Product
- Microsoft 365
- Device & OS
- not provided
- Scenario
- Running the Search-MailboxAuditLog cmdlet in Exchange Online to retrieve audit logs for a shared mailbox.
- Observed behavior
- The command returns an HTTP 401 Unauthorized error for one isolated shared mailbox, despite audit logging being active and administrator roles being configured properly.
Ensure you have double-checked that your admin account possesses the necessary Audit Logs or View-Only Audit Logs roles in Exchange Online, and verify that audit logging is actually enabled for the affected shared mailbox.
Contact Microsoft 365 Support via Admin Center
Since the required roles are assigned and the error affects only a single shared mailbox, the issue is likely a backend synchronization or object corruption problem that requires intervention from the dedicated Exchange Online support team.
When an HTTP 401 error is isolated to a single mailbox despite correct global configurations, standard troubleshooting steps via PowerShell often cannot resolve the underlying tenant issue. Escalating the issue to Microsoft's backend engineering team is the most effective approach.
Open your web browser and log in to the Microsoft 365 admin center using your global administrator or Exchange administrator credentials.
On the left-hand navigation pane, locate and click on 'Support', then select 'New service request' from the dropdown menu.
Describe the HTTP 401 Unauthorized error occurring with the Search-MailboxAuditLog cmdlet, explicitly stating that it only affects one shared mailbox and that proper roles are already assigned. Submit the request for further investigation.

Looking for a Lightweight and Reliable Office Suite?
While resolving administrative backend issues in Microsoft 365 requires IT support, your daily document work doesn't have to be complicated. WPS Office is a free, lightweight, and user-friendly alternative that provides excellent compatibility with Microsoft Office formats for all your local document needs.
- 1. Download WPS Office: Visit the official WPS website to download the free installation package for your operating system.
- 2. Install the Application: Run the installer and follow the on-screen instructions to set up WPS Office on your computer.
- 3. Open and Edit Documents: Launch WPS Office and instantly open your existing .docx, .xlsx, or .pptx files without formatting loss.

Frequently Asked Questions
Why do I get an HTTP 401 error on only one shared mailbox?
This typically indicates a backend synchronization issue, an orphaned permission state, or corrupted object metadata specific to that shared mailbox in Exchange Online, which requires Microsoft support to investigate.
What roles are required to run Search-MailboxAuditLog?
You must be assigned the Audit Logs or View-Only Audit Logs role in Exchange Online. These roles are usually assigned by default to the Compliance Management and Organization Management role groups.
How can I verify if mailbox audit logging is enabled?
You can connect to Exchange Online PowerShell and run the command 'Get-Mailbox -Identity <MailboxIdentity> | Format-List AuditEnabled' to check if audit logging is currently active for the specific mailbox.




