Schedule a Mailbox Export with Exchange 2007
A while ago I wrote about how to easily export Exchange 2007 MailBoxes to PST Files for archiving and backup purposes. Now that is OK if you want to run the process manually but what about scheduling the export for out of hours?
If you have followed the previous post and have successfully completed and export to PST File you will notice that you have to confirm that you want to proceed with the operation. Very annoying if you want to schedule this script and in fact the task will fail. This is how I managed to get around the need to confirm before proceeding prompt in the Exchange 2007 Management Shell.
If you remember from the previous post this command will export Mailboxes from a specific Database to individual PST Files.
get-mailbox -database “SERVER_NAME\DATABSE_NAME” | export-mailbox -PSTFolderPath C:\PSTFiles
With this command you will get a prompt asking you to Press A for All Y for Yes N for No etc etc. Not good if you want to schedule this.
Here is the KEY to avoid the prompts. Add -Confirm:$false to the end of the Export-Mailbox String. Therefore the new String would be:
get-mailbox -database “SERVER_NAME\DATABSE_NAME” | export-mailbox -PSTFolderPath C:\PSTFiles -Confirm:$false
All Done, Now you can Schedule away…….
