Forum Discussion
Problem to enable audit log on Public Folder Mailboxes via PowerShell command
I tried to run this and it keeps failing ![]()
PS C:\Users\user> Get-Mailbox -PublicFolder | Set-Mailbox -PublicFolder -AuditEnabled $true
Write-ErrorMessage : |Microsoft.Exchange.Configuration.Tasks.ThrowTerminatingErrorException|Parameter 'AuditEnabled' is not valid when parameter 'PublicFolder' is specified.
PS C:\Users\user> Get-Mailbox -PublicFolder | Set-Mailbox -PublicFolder | Set-Mailbox -AuditEnabled $true
WARNING: The command completed successfully but no settings of 'Production Public Folder' have been modified.
Hi, T.
That error appears to be correct, as auditing is not supported on resource or public folder mailboxes:
Cheers,
Lain
- tcz87Nov 08, 2023Copper Contributor
Something is not correct then. I am working on improving our Microsoft Secure Score and this is what I am on at the moment:
Not sure what I need to do next.
- LainRobertsonNov 08, 2023Silver Contributor
Hi, T.
I'm no Exchange Online expert but it seems either the advice in that message is bad, or the ExchangeOnlineManagement module simply doesn't support that functionality yet - I have no idea which of those two is true (if any are).
The error from Set-Mailbox is quite clear, and I've confirmed as much myself from a quick test.
Enabling auditing on a resource mailbox (in my test, I used a room mailbox) works fine. However, it fails as per your previous posts when trying the same thing on a public folder mailbox.
Someone with more Exchange Online knowledge might know of a way, but from the documentation and brief testing, I cannot see a way.
Cheers,
Lain