In some cases you may need to manually kickoff the Exchange Managed Folder Assistant in order to get archiving policies to run. The following command will run the managed folder assistant against “DATABASE01”.
Get-Mailbox -database “DATABASE01” -DomainController AD01 | Start-ManagedFolderAssistant
Managed folder assistance does not work in pipeline anymore, you need to user loop to perform action on all mail boxes or mailbox in a particular database. See examples below
For all Mail boxes
$mbxs = Get-Mailbox
foreach ($mbx in $mbxs) {
Start-ManagedFolderAssistant –Identity “$mbx”
}
For Mail boxes in particular database
$mbxs = Get-Mailbox -Database MailDB1
foreach ($mbx in $mbxs) {
Start-ManagedFolderAssistant –Identity “$mbx”
}
Be mind full depending on the amount of mail boxes the script will take little while to complete.