ExportMailToPst

Steven · 2021-09-22 13:04 · 121 views · Exchange · old id 86

## Put the location of your CSV file


$mail  = Import-Csv -Path "C:\mail.csv"
## Loop all users in the CSV
Foreach ($user in $mail)
{
$Alias = $user.MailboxAlias
$pst = $user.pst
## in the File path spicify the location to export the mailbox, it will be easy i f you choose a location where your account has full control right to share drive
New-MailboxExportRequest -Mailbox $Alias -FilePath \\HUBCAS-01\em\$pst
}

← Back to home