Hi,
I hope you can help me. I not able to run the script anymore.
It runs into an error:
[16.04.2026 20:15:02] Enumerating Exchange Online mail enabled public folders...
Write-ErrorMessage : Das Format des in den Parameter objectId eingegebenen Werts ist ungültig. Prüfen Sie den Wert, und versuchen Sie es erneut. (Parameter 'objectId')
In C:\Users\XX\AppData\Local\Temp\tmpEXO_g2bvrlzx.a5l\tmpEXO_g2bvrlzx.a5l.psm1:1191 Zeichen:13
+ Write-ErrorMessage $ErrorObject
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Get-MailPublicFolder], Exception
+ FullyQualifiedErrorId : [Server=FR6P281MB5297,RequestId=59cc36ec-5751-e774-d20d-d691b13f6e31,TimeStamp=Thu, 16 Apr 2026 17:36:02 GMT],Write-ErrorMessage
[16.04.2026 20:15:02] Mail public folders enumeration completed: 0 Exchange Online folder(s) found.
The following local mail public folder changes were detected and will be applied to Exchange Online: 200 object(s) created, 0 updated and 0 deleted.
The Script does not recognize the mail enabled objects anymore and wants to create new objects.
If I proceed with the WhatIf switch, it throws another error for each public folder ("The objectid does already exist in PF-Folder-Name"):
NewMailEnabledPublicFolder : ||Der OnPremisesObjectId-Wert "c72a283c-a009-4051-b4b6-17a15f54f4bb" wird bereits von "PF-Folder-Name" verwendet.
In C:\_Scripts\Sync-ModernMailPublicFolders.ps1:913 Zeichen:9
+ NewMailEnabledPublicFolder $localFolder;
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,NewMailEnabledPublicFolder
I had a problem with M365 notification mails in my Public Folders. These notifications had the wrong language. So I changed the regional settings of the public folder mailbox user objects and synced them again to M365. Now the script isn't running anymore (don't know if these two things are connected, but it seems so).
Public folders are still working on-prem and for M365 users, but I'm not able to sync new mail enabled public folders.
Any help?
Thanks!