Skip to content

Instantly share code, notes, and snippets.

@maestropanel2
Last active January 10, 2022 12:06
Show Gist options
  • Save maestropanel2/8fb733c62719c0c08c1108f4dd4582d8 to your computer and use it in GitHub Desktop.
Save maestropanel2/8fb733c62719c0c08c1108f4dd4582d8 to your computer and use it in GitHub Desktop.
Optimal New-MailboxImportRequest for MaestroPanel Exchange
#Exchange Server 2013/2016 Import Script
#Desc: This script importes all mailbox backup files in directory to Exchange Server
#Url: https://wiki.maestropanel.com/exchange-servera-toplu-sekilde-pst-dosyasi-import-etmek/
#Author: MaestroPanel Support
#Email: ping@maestropanel.com
. 'C:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'
Connect-ExchangeServer -Auto
#Change this line for your directory path
$Source = "\\localhost\c$\backupmail"
Get-ChildItem *.pst -Path $Source | Select Name,BaseName | ForEach {
New-MailboxImportRequest -MailBox $_.BaseName -FilePath "$Source\$($_.Name)" -InternalFlags "SkipPreFinalSyncDataProcessing","SkipWordBreak","SkipStorageProviderForSource","SkipMailboxReleaseCheck","SkipProvisioningCheck","DoNotConvertSourceToMeu" -AcceptLargeDataLoss -LargeItemLimit unlimited -BadItemLimit unlimited -Confirm:$false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment