Avatar of leop1212
leop1212
Flag for United States of America asked on

Public folder for 365 and exchange on premise hybrid mode

We do have exchange 365 and exchange on premise configured to work on in hybrid mode.  Initially we migrated public folder from exchange on prem to exchange online. 

So Exchange on Prem remember info for all existing Public folders at time prior to migration.

 

Our MX record points to an SMTP email filter  on Prem.  SMTP filter delivers SMTP traffic to Exchange on Prem and 365 emails are properly forwarded.

Now I would like to create new mail enabled public folder  say newpfmailto:newpublicfolder@mydomain.com.

Since I create new folder on 365 and there is no sync on public folders to on prem

exchange on prem don't know that mailto:newpublicfolder@mydomain.com  is a valid email address on 365 and it will reject the email.

I do prefer public folder for this case vs shared mailbox cause  Mail enabled public folder is much easier to use for my purposes :.

  1. I can configure security access for each user ( owner, reviewer , etc..) while with shared mailbox is all or nothing (even though in theory you can assign different right to subfolders via PowerShell). 
  2. Shared mailbox is caching in in the outlook and having too many shared mailbox balloons cached outlook profile.                                                                                                                                                 

 My question is ( please don't through any random answers)  

how to configure new public folder so that email from outside of my domain hits SMTP gateway then Exchange On prem and gets forwarded to 365 newpf@mydomain.com t  PF?

I do want to use email address to be mailto:newpf@mydomain.com  i don't want to use newpf@mydomain.onmicrosoft.com

and I'd like to avoid creating another  shared or user mailbox with a forward rule to a public folder.

 

ExchangePowershell

Avatar of undefined
Last Comment
leop1212

8/22/2022 - Mon
Jakob Digranes

you need to sync mail enabled public folders. More information here: https://docs.microsoft.com/en-us/exchange/hybrid-deployment/set-up-exo-hybrid-public-folders

using this command:
Sync-MailPublicFoldersCloudToOnprem.ps1 -Credential (Get-Credential)
Credentials = 365 user/pass

as the web page states: 

 Note

We recommend that you run this script daily to synchronize your mail-enabled public folders.

leop1212

ASKER
it looks like exactly what i am looking for.
however I am getting this error when i
opened powershell as an admin
Connect-exchangeonline
 Sync-MailPublicFoldersCloudToOnprem.ps1 -Credential (Get-Credential)
and i am getting error below
thank you

cmdlet Get-Credential at command pipeline position 1
Supply values for the following parameters:
Credential
Sync-MailPublicFoldersCloudToOnprem.ps1 : The term 'Sync-MailPublicFoldersCloudToOnprem.ps1' is not recognized as the
name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ Sync-MailPublicFoldersCloudToOnprem.ps1 -Credential (Get-Credential)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (Sync-MailPublicFoldersCloudToOnprem.ps1:String) [], CommandNotFoundExce
   ption
    + FullyQualifiedErrorId : CommandNotFoundException
ASKER CERTIFIED SOLUTION
Jakob Digranes

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
leop1212

ASKER
i am all set
thank you very much
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
leop1212

ASKER
great solution
leop1212

ASKER
Jacob,
 i ran your script few time, however, exchange on premise still doesn't see new public folder email address ?
any ideas?
 
Jakob Digranes

Om holiday, so on mobile only and limited testing possibilities
1. are PFs mail enabled in cloud?
2. are ADconnect configured for Exchange Hybrid?
3. looking at the scripts - does it pro

I’m out hiking today - so offline until tomorrow late morning, sorry for any late responses
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
leop1212

ASKER
Jakob,
1. yes PF folder in question is mail enabled and I can send emails from other 365 mailbox but not from on premise
2.  ADconnect is configured for a hybrid mode and sync the delta changes.
i can create shared mailbox on prem and migrate it to the cloud and i can send emails not problem from outside and from on prem and on 365
3. scrip it processing ?
4. public folder set to receive emails from anonymous and from outside
no rush to answer enjoy a nice weather outside.
thank you
Jakob Digranes

Hi
Back at the keyboard now. Are there any logs processsed from the script? It would create a summary CSV file I see - anything in this file? 
leop1212

ASKER
Jakob,
sorry i was OOF for a couple of days
i temporary created shared mailbox on exchange on prem and port shared mailbox to the cloud and configure forward to new public folder
however I do like to have new public folder email address sync to on premise.
the only log from running your script is

“CompletedStatsCount = Total sync mail mail public folders created: {0}, updated: {1} and deleted: {2}.”

thank you for staying on it.

 
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck