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-MailboxFolder.ps1: WhatIf flag still creates folders #54

Closed CSchulz closed 3 months ago

CSchulz commented 3 months ago

I have noticed that using the Merge-MailboxFolder.ps1 with the what if flag still creates folders and do not just tell what its plan is:

.\Merge-MailboxFolder.ps1 -SourceMailbox test@schulzolutions.de -TargetMailbox kontakt@schulzolutions.de -ProcessSubfolders -CreateTargetFolder -Copy -Office365 -Impersonate -WhatIf -OAuth -OAuthClientId ...

11.06.2024 10:09:34 [Merge-MailboxFolder.ps1] Merge-MailboxFolder.ps1 version 1.4.1 starting
11.06.2024 10:09:34 [LoadEWSManagedAPI] Using EWS Managed API found at: ...PowerShell-EWS-Scripts\Legacy\Microsoft.Exchange.WebServices.dll
Processing mailbox test@schulzolutions.de
11.06.2024 10:09:35 [MoveItems] Copying from test@schulzolutions.de:\Top of Information Store to kontakt@schulzolutions.de:\Oberste Ebene des Informationsspeichers
11.06.2024 10:09:36 [MoveItems] No matching items were found
11.06.2024 10:09:39 [MoveItems] Copying from test@schulzolutions.de:\Top of Information Store\Archive to kontakt@schulzolutions.de:\Oberste Ebene des Informationsspeichers\Archive
11.06.2024 10:09:39 [MoveItems] 2 items found; attempting to copy
11.06.2024 10:09:39 [ThrottledBatchMove] Would move/copy AQMkADM5YWQ4MTlhLTgzYzQtNDA5YS04OTg2LWE3ODAxNjhjOTZhMgBGAAADuTyc79aH/UOcbV8l+iHU4wcA8EqWIiP590+bN7i/0kma1wAAAgE/AAAA8EqWIiP590+bN7i/0kma1wACKj3PiQAAAA==
11.06.2024 10:09:39 [ThrottledBatchMove] Would move/copy AQMkADM5YWQ4MTlhLTgzYzQtNDA5YS04OTg2LWE3ODAxNjhjOTZhMgBGAAADuTyc79aH/UOcbV8l+iHU4wcA8EqWIiP590+bN7i/0kma1wAAAgE/AAAA8EqWIiP590+bN7i/0kma1wACKj3PigAAAA==
David-Barrett-MS commented 3 months ago

Yup, there was a logic error. Fixed in 1.4.2 (just published). Thanks for reporting.