Hi,Roger Roger
Based on your question, I understand that you are experiencing an error when running the command.
You could provide more information about the error so that I can take the next step in troubleshooting.
After my tests, the command you provided has no syntax errors and is able to export the .csv file successfully. My test results are shown below.
Regarding your error message, you could try the following steps:
- The Search-MailboxAuditLog cmdlet may be deprecated. You will need to switch to a Search-UnifiedAuditLog cmdlet. For more information, please check Important Announcement: Deprecation of AdminAuditLog and MailboxAuditLog Cmdlets - Microsoft Community Hub
- Ensure that the account performing the action has the required permissions to access the audit log. For permissions needed, please see Find the permissions required to run any Exchange cmdlet | Microsoft Learn. You also could test with another admin account and check if the issue persists.
- Check that the parameters are spelled correctly. Ensure that the e-mail address or the path where the file is stored is entered correctly.
- Did you get the error with other commands, such as Get-MessageTrackingLog ?
If my answer is helpful to you, please mark it as the answer so that other users can refer to it. Thank you for your support and understanding.