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

moving items inside the same mailbox #38

Closed jhjacobs81 closed 10 months ago

jhjacobs81 commented 10 months ago

My apologies if i am asking the obvious, ive been frying my brain over this one for the past week.

I am dealing with "a migration gone wrong" situation where there's problem with the language settings. Originally everything was in Dutch, so "Postvak In, Verzonden Items, Kalender". After a migration from pst files everything new is in "Inbox, Send Items, Calendar".

And i am unsure how to use MergeFolder.ps1 to merge two folders in the same mailbox?

jhjacobs81 commented 10 months ago

so, to answer myself and hopefully future people, this seems to do the trick:

.\Merge-MailboxFolder.ps1 -SourceMailbox "" -MergeFolderList @{ "Inbox"= "Postvak In"; "Send Items"= "Verzonden Items"; "Calendar"= "Agenda"; "Deleted Items"= "Verwijderde Items"; "Junk Email"= "Ongewenste e-mail"; "Notes"= "Notities";
"Drafts"= "Concepten" } -ProcessSubfolders -CreateTargetFolder -Office365 -OAuth -OAuthClientId "{{SECRET}}" -OAuthTenantId "{{SECRET}}" -OAuthSecretKey "{{SECRET}}" -Delete

This helped me move from the original Dutch folders to the English folders that where somehow set by the PST import.