Exporting all mailboxes whose associated user accounts are stored in a specific OU to a PST file

$Export = Get-User -OrganizationalUnit “yourdomain.com/OU/SubOU” -Filter “RecipientType -eq ‘UserMailbox'” | Get-Mailbox ; $Export|%{$_|New-MailboxExportRequest -FilePath \\fileshare\share\$($_.alias).pst}

This script will locate all users with mailboxes located in the OU you specify in the “yourdomain.com/OU/SubOU” section. It will then export them to the file share you specify in the \\fileshare\share\$($_.alias).pst section. Make sure you keep the $($_.alias).pst variable in the script. It will ensure that the pst files are created with the alias of the user being exported at that time.

Share Button
Author: JA

Leave a Reply

Your email address will not be published.