Export-mailbox to PST


hello,

want export mailboxes exchange 2010 sp1 pst files follow article http://www.msexchange.org/articles_tutorials/exchange-server-2010/management-administration/look-import-export-mailbox-improvements-exchange-2010-service-pack-1-part2.html with cmdlet $export = get-mailbox –database mdb01 ; $export|%{$_|new-mailboxexportrequest -filepath "\\ex02\pstfiles\$($_.alias).pst"} and perfect, want add option divide pst files trimester, don't know how.
target create batch file automatic divide mailboxes trimester , put pst files onto respective folder.
example: user1
emails 01/01/2010 - 31/03/2010 -> 2010 trimester 1
emails 01/04/2010 - 30/06/2010 -> 2010 trimester 2
emails 01/07/2010 - 30/09/2010 -> 2010 trimester 3
emails 01/10/2010 - 31/12/2010 -> 2010 trimester 4

possible automate script create folders trimester each year?

thanks...

hi martinho,

as understand, want export mails within the mailboxes separate pst files dependent on item date? should work:

  $export = get-mailbox -database mdb01 $export | % {  	$_ | new-mailboxexportrequest -filepath "\\ex02\pstfiles\$($_.alias)_t1.pst" -contentfilter {(received -ge '01/01/2010') -and (received -le '31/03/2010')}} 	$_ | new-mailboxexportrequest -filepath "\\ex02\pstfiles\$($_.alias)_t2.pst" -contentfilter {(received -ge '01/04/2010') -and (received -le '30/06/2010')}} 	$_ | new-mailboxexportrequest -filepath "\\ex02\pstfiles\$($_.alias)_t3.pst" -contentfilter {(received -ge '01/07/2010') -and (received -le '30/09/2010')}} 	$_ | new-mailboxexportrequest -filepath "\\ex02\pstfiles\$($_.alias)_t4.pst" -contentfilter {(received -ge '01/10/2010') -and (received -le '31/12/2010')}} }  


please aware not "perfect powershell". there ways make fit more in line correct programming/scripting procedures, script above should make sense beginner , advanced alike. we're running 4 exports each mailbox (as exchange admin, can tell take forever). -contentfilter block lets filter on objects within mailbox. see here more info on -contentfilter:

http://technet.microsoft.com/en-us/library/ff601762.aspx

 

hope helps!

chris



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

WIMMount (HSM) causing cluster storage to go redirected (2012r2 DC)

Failed to delete the test record dcdiag-test-record in zone test.com

Azure MFA with Azure AD and RDS