June 11, 2012

Export mailbox to PST in exchange 2010

Exporting mailbox content to pst can be a time consuming task. However, in many cases this is necessary when an employee leaves the firm and requests to bring all their content with them.

Here are you steps: 

1: Assign the Role to yourself and whoever needs to perform the task:

New-ManagementRoleAssisgnment -Role "Mailbox Import Export" -User <username>

2: Create the export task and set the location for the .pst file.

New-Mailboxexportrequest -Mailbox <username> -PSTFolderPath c:\public\desktop\<username>.pst

(Alternatively you can use:
 Export-mailbox -Identity <username> -Filepath "c:\<filepath>\<username>.pst")


3:  To check on the status of the export

get-mailboxexportrequest |  get-mailboxexportstatistics

To remove export requests:
 

get-mailboxexportrequest |  remove-mailboxexportrequest

get-mailboxexportrequest -status completed |  remove-mailboxexportrequest

get-mailboxexportrequest -status completed |  ?{$_.account.status -ne "disabled"} | remove-mailboxexportrequest

get-mailboxexportrequest -status completed |  ?{$_.user -eq "mail-enabled"} | remove-mailboxexportrequest


This is handy when completing mass exports:

Get-moverequest | ?{$_.status -ne "completed" -and $_.status -ne "completedwithwarning" } |  group targetdatabase | sort count -descending

No comments:

Post a Comment