Forum Discussion
Make On-Prem Public Folders Accessible to Exch Online Users-MailUser Obeject sync is confusing me
Howdy Exchange Brain Trust!
I'm working on a exchange server 2019 migration to EXO. Part of it is Public folders but at this stage I do not want to migrate them but simply make them working cross-premises for migrated users.
I've followed this official guide from MS - https://learn.microsoft.com/en-us/exchange/hybrid-deployment/set-up-modern-hybrid-public-folders but the first step (Synchronize MailUser objects script execution) output is confusing me.
[PS] C:\Temp>.\Sync-ModernMailPublicFolders.ps1 -CsvSummaryFile:sync_summary.csv
Checking for mail-enabled System folders...
Found 0 mail-enabled System folders.
Getting all public folders. This might take a while...
Found 200 public folders.
8 of those are mail-enabled.
1 folders are mail-enabled with no AD object.
7 folders are mail-enabled and are properly linked to an existing AD object.
Getting all MailPublicFolder objects...
10 MailPublicFolders are orphaned.
Building EntryId HashSets...
10 orphaned MailPublicFolder objects.
1 of those orphans point to mail-enabled folders that point to some other object.
2 of those orphans point to mail-disabled folders.
Results:
1 folders should be mail-disabled, either because the MailRecipientGuid
does not exist, or because they are system folders. These are listed in the file called:
C:\Temp\FoldersToMailDisable.txt
After confirming the accuracy of the results, you can mail-disable them with the following command:
Get-Content "C:\Temp\FoldersToMailDisable.txt" | % { Disable-MailPublicFolder $_ }
7 MailPublicFolders are orphans and should be deleted. They exist in Active Directory
but are not linked to any public folder. These are listed in a file called:
C:\Temp\MailPublicFolderOrphans.txt
After confirming the accuracy of the results, you can delete them with the following command:
Get-Content "C:\Temp\MailPublicFolderOrphans.txt" | % { $folder = ([ADSI]("LDAP://$_")); $parent = ([ADSI]"$($folder.Parent)"); $parent.Children.Remove($folder) }
1 MailPublicFolders are duplicates and should be deleted. They exist in Active Directory
and point to a valid folder, but that folder points to some other directory object.
These are listed in a file called:
C:\Temp\MailPublicFolderDuplicates.txt
After confirming the accuracy of the results, you can delete them with the following command:
Get-Content "C:\Temp\MailPublicFolderDuplicates.txt" | % { $folder = ([ADSI]("LDAP://$_")); $parent = ([ADSI]"$($folder.Parent)"); $parent.Children.Remove($folder) }
The duplicates we are deleting contain email addresses that might still be in use.
To preserve these, we generated a script that will add these to the linked objects for those folders.
After deleting the duplicate objects using the command above, run the script as follows to
populate these addresses:
.\C:\Temp\AddAddressesFromDuplicates.ps1
No mail-disabled public folders with proxy GUIDs were found.
2 MailPublicFolders are disconnected from their folders. This means they exist in
Active Directory and the folders are probably functioning as mail-enabled folders,
even while the properties of the public folders themselves say they are not mail-enabled.
This can be complex to fix. Either the directory object should be deleted, or the public folder
should be mail-enabled, or both. These directory objects are listed in a file called:
C:\Temp\MailPublicFoldersDisconnected.txt
Done!
Confirm
Are you sure you want to perform this action?
Performing the operation "Remove File" on target "C:\Temp\sync_summary.csv".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): Y
-------------------------------------------------------
My Questions are:
1. Does this mean the output of the script was just "observation only" no objects were synced? (all I need at this stage is to allow EXO users access on-prem public folders. Is this step really necessary for that?)
2. Also received the error at the end after saying "Y" to the prompt to "Performing the operation "Remove File" on target. Is this only affecting the file removal or overall sync as well?
Any clarity around these questions are really appreciated !! Thank you!
Kev
3 Replies
- goetzgirkeCopper Contributor
You only need the script if you have mail enabled public folders. It is important that the AD object for the PublicFolder mailbox is sync to the cloud via ADsync.
You then need to adjust the organization configuration in Exchange Online so that your online mailboxes know where to find the public folders:
https://learn.microsoft.com/en-us/exchange/hybrid-deployment/set-up-modern-hybrid-public-folders#step-3-configure-exchange-online-users-to-access-exchange-server-on-premises-public-folders - chrisslrothBrass ContributorHey Curious_Kevin16, I recommend not to use public folders in exchange online. Create shared mailboxes or m365-groups and import the mails from onPrem PF to shared MB.
1.) No Objects were snyced, please check the prerequirements: https://learn.microsoft.com/en-us/exchange/hybrid-deployment/set-up-modern-hybrid-public-folders
2.) It's only affecting the file removal.- Curious_Kevin16Iron Contributorchrisslroth,
Any reasons why Public folders in EXO isn't a good idea ? (except its just being a legacy feature).
That'lll require recreation of permissions and everything from scratch. Is there any option to import the content/structure directly other than migrating?
Thanks a lot for your information!