David-Barrett-MS / PowerShell-EWS-Scripts

A collection of PowerShell scripts that use EWS to perform actions against Exchange mailboxes
MIT License
118 stars 13 forks source link

Merge-MailboxFolders various issues (v1.3.0 / 1.3.2) #46

Closed bwlonsdaledxc closed 7 months ago

bwlonsdaledxc commented 8 months ago

Hi David, this had been working great until last week, we can no longer get mail moving out of mailboxes into their archive.

Q: If user has MFA enabled, will this still work? We have a number of users (including myself) who have MFA enabled now.

Script v1.3.0 / Microsoft.Identity.Client 4.45.0 / Microsoft.Exchange.WebServices v15.00.0913.015

If we try and use v1.3.0 to run as a job, that appears to have stopped working (it did this previously and you fixed it with v1.3.0).

https://github.com/David-Barrett-MS/PowerShell-EWS-Scripts/issues/30

https://github.com/David-Barrett-MS/PowerShell-EWS-Scripts/issues/28

I've tried using v1.3.2 but same issues around job use and other issues. I've attached some logs which may help show what is going on, v1.3.0 and v1.3.2

Both curently stop with an error around a null-value - it ran previously through the mailbox OK, but latest runs now throw this error as shown in error txt attachment.

When ran interactively, the mailbox is processed but nothing has been actually moved, e.g. Inbox has 760 items in it and after a run, still contains 760.

I've attached a few logs from runs using 1.3.0 and 1.3.2 for comparison, the commandline that calls your script is in the 4. file Error_Logs.zip

As an additional note, the permissions model for our admin accounts also changed, we now have to use PIM to apply Exchange Administrator rights (which we run the script under). To build the folder list from Exchange Online cmdlets, I would have thought that was enough? We get the elevated session for a set period of time (on the order of hours). I've ran these all after PIM has been applied for at least an hour.