Utilizing the Archive Merchandise operation in EWS

Utilizing the Archive Merchandise operation in EWS As there was a little bit of discuss archiving recently and the brand new Archive Folder vs the On-line Archive in Workplace365 https://help.workplace.com/en-us/article/Archive-in-Outlook-2016-for-Home windows-25f75777-3cdc-4c77-9783-5929c7b47028?ui=en-US&rs=en-US&advert=US and https://www.petri.com/exchange-online-archive-options .I might although I might do a submit about the Archive Merchandise operation in EWS which was launched in Alternate 2013 and is an fascinating lever for admins to make use of in the event that they need to look a manually archiving objects to a Mailboxes on-line archive with out utilizing Archive Insurance policies. The Archive Merchandise operation is mainly designed to mean you can transfer objects from the Major to the On-line Archive extra simply as an alternative of getting to batch a Transfer operation. To make use of this operation you want to enumerate the Objects you need to archive (utilizing a search filter or different restriction) after which present that as one of many inputs for archive Objects as longs because the folder the place the Objects are being archived from. The one actual catch I’ve discovered when utilizing it’s that you want to use Impersonation or the Automated folder creation within the Archive would not appear to occur.

I’ve created a script that means that you can question a Mailbox folder utilizing an AQS question primarily based on the merchandise obtained date after which invoke the Archive Objects operation on these objects and put this up on GitHub right here https://github.com/gscales/Powershell-Scripts/blob/grasp/ArchiveItems.ps1

This script requires EWS impersonation https://msdn.microsoft.com/en-us/library/workplace/dn722376(v=exchg.150).aspx to run

To run the script you move within the Mailbox you need to run the script in opposition to, the FolderPath the place the Objects exist that you just need to archive and the Date of the Objects you need to archive from. Eg to archive objects older then one yr you’d run

Invoke-ArchiveItems -MailboxName consumer@area.onmicrosoft.com -FolderPath “Clutter” -queryTime (Get-Date).AddDays(-365)

Leave a Reply