how would this look? username, username, pstfilename.
I am not clear on the csv format the rest of the script is ok i post all of it incase that helps.
http://gallery.technet.microsoft.com/scriptcenter/e46edf5b-3d82-4f11-a3fa-665f32df6bd8?SRC=Home # Set up variables (CSV file format id, pst = userid and pst file name)[/style]
$data = Import-CSV d:\import.csv
# Set Database for user mailboxes
$exhdb= "Mailstore Users"
# Set Domaincontroller for user mailboxes
$dcname = "dc01.contoso.com"
#Import the data from PST
ForEach ($i in $data){
Enable-Mailbox -Identity $i.id -Database $exhdb -DomainController $dcname
# Set server name where file share for PST is
$pstpath = "\\ServerX.contoso.com\pst\" + $i.id + "\" + $i.pst
Write-Host "Press any key to continue ... wait for 60 sec"
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Write-Host
Write-Host "1"
Write-Host "2"
Write-Host "Starting PST Import"
Start-Sleep -s 30
New-MailboxImportRequest -filepath $pstpath -Mailbox $i.id -BadItemLimit 40 -DomainController $dcname
Write-Host "Press any key to continue ... wait for another 60 sec"
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Write-Host
Write-Host "4"
Write-Host "5"
Write-Host "Resume PST Import"
Start-Sleep -s 10
$iden = $i.id + "\MailboxImport"
resume-MailboxImportRequest -identity $iden -DomainController $dcname
}