Forum Discussion
tcz87
Nov 02, 2023Copper Contributor
Problem to enable audit log on Public Folder Mailboxes via PowerShell command
Hi all, I am trying to enable the audit logs for the Public Folder Mailbox via the PowerShell command following MS recommendation, but I am getting an error. Does anyone know what am I doing wron...
LainRobertson
Nov 02, 2023Silver Contributor
Hi, T.
Having a read of the documentation, you need to include the -PublicFolder parameter in the Set-Mailbox commandlet:
Cheers,
Lain
- tcz87Nov 02, 2023Copper Contributor
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.- LainRobertsonNov 02, 2023Silver Contributor
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.