I'm trying to move the content of one folder in Exchange Online to the 'In-Place Archive'. As I have to do this for different folder for different users I was thinking of doing it with Powershell Search-Mailbox
but I can´t find the proper path to put in -TargetMailbox
Could you point it out?
As far as I know, it couldn’t simply use “search-mailbox” to move items to in-place archive mailbox, I found a script using EWS API, you could try it: https://gallery.technet.microsoft.com/scriptcenter/Move-emails-to-Archive-or-5394bb0d
In addition, I think it is better to use retention policy to move items to in-place archive.
Be careful with 'In-Place Archive'. There is no way to get folders back programmatically.
Docs (https://docs.microsoft.com/en-us/graph/api/resources/mail-api-overview?view=graph-rest-1.0):
This means that you have one-way road. You can place messages and folders in 'In-Place Archive', but we cannot find a way to access it those archived folders.
We broke our teeth on this (https://4bis.nl/en/blog-updates/4bis-software/2019/05/01/quote-manager-what-is-it-and-why-do-you-need-it this tool).
If anybody has ideas about this, please, don't be a stranger. See also: https://docs.microsoft.com/en-us/answers/questions/86478/collect-inplace-archives-mail-folder-from-exhange.html
FYI: Reading up on the Search-Mailbox, and it looks like Microsoft is deprecating the Search-Mailbox cmdlet in cloud-based environments (Exchange Online) in favor of New-Compliance Search