When you enable Exchange Online Archiving for a user on Office 365, it can take 24 hours or more for the Managed Folder Assistant to start it’s first run and begin archiving email out of the primary mailbox.
Edit: If you’re using the Exchange Online v2 PowerShell module, then this process is considerably simpler, and supports Modern Authentication.
Connect-ExchangeOnline
Start-ManagedFolderAssistant -Identity user@example.com
If you want this process to start immediately, connect to Office 365 with PowerShell and tell the Managed Folder Assistant to start running.
$UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session Start-ManagedFolderAssistant -Identity user@example.com
Then wait 5 minutes or so for it to begin running and check the progress via logging in to OWA and looking at either the contents of the In-Place Archive mailbox in the left-hand sidebar or via the Exchange Admin Centre > Mailboxes > Recipients > In-Place Archive > View details.
it worked..
Thanks..
To do all users
$UserMailboxes = Get-Mailbox -Filter {(RecipientTypeDetails -eq ‘UserMailbox’)} $UserMailboxes | ForEach {Start-ManagedFolderAssistant $_.Identity}
This is a cleaner script to trigger the archiving for all users. -Filter also doesn’t appear to be an available switch for get-mailbox in the new PS Module.
Get-Mailbox -RecipientTypeDetails UserMailbox -ResultSize unlimited | ForEach {Start-ManagedFolderAssistant $_.Identity}
That’s heaps simpler, thank you for the code snippet.
thanks for the code
Any ideas on the error I get? The call to Mailbox Assistants Service on server: ‘xxxx.xxxx.prod.outlook.com’ failed. Error from RPC is -2147220992.
You need to log in to the mailbox after enabling it – e.g. in Outlook on the web. This prompts Exchange Online to create the mailbox, and then you can force archiving to start.
Hi Guys,
it doesn’t work Hybrid Environment.
Yeah, I don’t have any experience with Hybrid environments, all of my clients are 100% cloud.
You could disable the archive option for that email account and then enable it, wait for a short while and then recheck and the archiving process should have kicked in. You can tell it’s working by checking under Mailbox Features –> Archiving: Enabled and it should confirm the size of the archive mailbox underneath. Refresh it after a minute and go back and the size should have increased.
Archiving often does not start immediately after enabling it on a mailbox, hence the whole reason for this post. The Managed Folder Assistant process that performs the archiving usually only runs once every 24 hours.
Hey all. I had configured a mailbox for archive and set retention to it and ran this command several times over the day with no luck. Contacted Microsoft to see what the deal is. Apparently even me forcing the policy it can take a day and up to a few days to start that processing. Her explanation was that Office 365 runs on shared resources with other customers and the Archive policy runs every 7 days by default and when we force it all we do is just add it to the queue to be processed skipping the 7 day timer.
Not only in my experience, but this has been clarified to me by Microsoft reps: The archiving process can take many days.to complete. It can be a royal pain, but that’s the way it is. I have been migrating emails for clients from IMAP servers to Microsoft 365. When mailboxes are over 50GB (and many are in these cases) I start by migrating the older emails using a date filter – say from 2019 and before. Then I make sure that archiving for that user is turned on, and then use the accepted PowerShell command to force archiving: “start-managedfolderassistant -identity user@domain.onmicrosoft.com”
And then I wait. And Wait. Typically 2-3 days or more. When enough messages are in the archive and there’s (hopefully) enough space for the rest of the messages, I continue the migration process with later-dated emails.
Another trick is to change the user to an Office 365 E3 instance, which gives me 100GB of main mailbox space. Migrate all the emails, wait (and wait!) for the In-Place Archive to populate, and then, if the main mailbox storage is low enough, I convert the user back to Microsoft 365 Standard. If not, I inform the client and they pay for the extra mailbox space (or set the mailbox to archive more recent emails if the archive can hold it). Fun, huh?
With some luck, I have saved the largest user(s) for last, and these will need the E3 instance regardless, so it’s not wasted.
I have setup the IMAP server and M365 in a split-domain arrangement, where users can be on either server (but not the identical email address on both).
Only after I’m satisfied that the user’s migrated mailbox is in order do I deactivate the IMAP mailbox (by renaming the user), remove the “onmicrosoft” from the M365 mailbox and make it live. There are a few other steps in the process, but that’s the gist of it.
Nice! Worked!
For these who track de archive status, uses Get-MailBoxStatistics
This powershell code loops every seconds and update screen showing:
$Recipient = 'your@domain.com'
while($true){
$normal = Get-MailboxStatistics -Identity $Recipient | select @{N="Type";E={"Normal"}},ItemCount,TotalItemSize
$archive = Get-MailboxStatistics -Identity $Recipient -Archive | select @{N="Type";E={"Archive"}},ItemCount,TotalItemSize
clear-host;
$result = @($normal) + @($archive)
write-host ($result | out-string);
start-sleep -s 1;
}
Nice one, thank you for sharing the snippet.
Thank for this code!
Is there a maxiumum number of days an online archive can exist before EOL deletes it from one of the default folders such as “Inbox” if no “never delete” policy is applied?
Depending on the MRM policy applied to items in, say, the Inbox, this will control how long until it’s moved to the online archive.
You can have different policies on different folders, so you could have all of your Sent Items being moved to archive after 6 months, but apply a 3 year retention policy to the Inbox, and make another folder with a never archive policy. This folder with the never archive policy will not have any items moved to online archive ever.