Hybrid Exchange Public Folder Access

Matt Pollock 241 Reputation points
2021-12-13T16:34:01.347+00:00

Hi,

I am in the process of working through a test plan after recently setting up hybrid Exchange with O365.

I have been trying to follow the steps outlined in this MS article, with a view to testing O365 user access to on premise public folders.

https://learn.microsoft.com/en-us/exchange/hybrid-deployment/set-up-modern-hybrid-public-folders

I've not managed to get very far in my lab however, as I am met with an "Access denied" error when attempting to run the following command, as part of the process:

.\Sync-ModernMailPublicFolders.ps1 -Credential (Get-Credential) -CsvSummaryFile:sync_summary.csv

The credentials I am inputting are my global admin creds for O365.
I am able to connect to ExchangeOnline via Powershell with the same creds so I cannot see that there would be a permissions issue at this point:

Error returned from attempting to run the script:
157227-image.png

Successful connection ExchangeOnline using the same creds
157234-image.png

I don't really know where to begin with troubleshooting this one.
Any ideas would be greatly appreciated.

Thanks

Matt

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,059 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,227 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Andy David - MVP 138.6K Reputation points MVP
    2021-12-13T17:01:02.657+00:00

    Is that account protected by MFA? If so, temporarily remove that MFA requirement or use another account that isnt using MFA and try that.

    2 people found this answer helpful.

  2. KyleXu-MSFT 26,201 Reputation points
    2021-12-14T06:26:20.773+00:00

    @Matt Pollock

    From the script, we can know it connect to Exchange online in the way of basic auth:

    157344-qa-kyle-14-23-42.png
    157391-qa-kyle-14-23-14.png

    So, try to connect to Exchange online in this way first. If you cannot connect to Exchange online with basic auth, double check about the "What do you need to know before you begin" part in above article. Make sure configuration is correct.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.



  3. Matt Pollock 241 Reputation points
    2022-01-27T10:32:09.427+00:00

    The reason the scripts do not work is because Microsoft have disabled basic authentication in many if not all customer tenants.
    The PF sync scripts rely on basic authentication to work.

    This is discussed in this thread

    https://github.com/MicrosoftDocs/OfficeDocs-Exchange/issues/1563

    One of comments mentions a modified script - Sync-ModernMailPublicFoldersV2.txt - which can be used as a workaround to the original scripts, which Microsoft have yet to fix.

    I have run the modified script and successfully synced the on prem PF's with O365.

    0 comments No comments