This little script if for export mailboxes to a pst files form an Exchange 2010 SP1 or SP2  or SP3

to change:

  • e:\exchange –>path to export pst files (\\server2k\e$\Exchange)
  • F:\Exchange\bin ->path to exe of Exchange
  • F:\backup –>path to ps script

first, assing role to users administrator

New-ManagementRoleAssignment –Role "Mailbox Import Export" –User Administrator

 the script:

Connect-ExchangeServer -auto;
Remove-Item <a href="file:///\\murano\F\Exchange\*.pst">\\murano\F\Exchange\*.pst</a> -recurse;
Get-MailboxExportRequest | where {$_.status -eq "Completed"} | Remove-MailboxExportRequest -confirm:$false;
Get-MailboxExportRequest | where {$_.status -eq "Failed"} | Remove-MailboxExportRequest -confirm:$false;
foreach ($i in (Get-Mailbox))
	{ New-MailboxExportRequest -Mailbox $i -FilePath "<a href="file:///\\murano\F\Exchange\$($i.Alias).pst">\\murano\F\Exchange\$($i.Alias).pst</a>"  -baditemlimit 200 -AcceptLargeDataLoss }

then, create one new scheduled task:


with this parameters:


-version 2.0  -command “. ‘F:\Exchange\bin\RemoteExchange.ps1’; Connect-ExchangeServer -auto;. ‘F:\backup\exportmailboxes.ps1′”

{jcomments on}