Export Mailboxes to PST using CSV

Hello - I'm in the process of exporting mailboxes from another exchange server from a company we acquired so I can import email into their new mailbox. I have a CSV formatted with headers
old,new which has their old alias and new alias. I also only want to capture the last 60 days of email. However, I seem to be missing something in formatting as it keeps creating a new line instead of just executing the script. I'm at a loss and can't seem
to get this working.
$sixty = get-date -format "M/d/yyyy" (get-date).AddDays(-60)
$UserList=Import-CSV C:\users.csv
FOREACH ($Person in $UserList) {
New-MailboxExportRequest -Mailbox $Person.old -ContentFilter {(MessageKind -eq 'Email') -and (Received -gt $sixty) -or (Sent -gt $sixty)} -FilePath "\\server\pst\"$Person.new".pst"
Any help would be appreciated!

Try
$sixty = get-date -format "M/d/yyyy" (get-date).AddDays(-60)
$UserList=Import-CSV C:\users.csv
FOREACH ($Person in $UserList) {
New-MailboxExportRequest -Mailbox $Person.old -ContentFilter {(MessageKind -eq 'Email') -and ((Received -gt $sixty) -or (Sent -gt $sixty))} -FilePath "\\server\pst\$($Person.new).pst"
CRM Advisor

Similar Messages

  • Exchange 2010 Export Mailbox to PST using only .EDB file

    I have Exchange 2010 SP2 Update Rollup 4, SBS 2011 (which is similar to Server 2008 R2). I have recently recovered from a server crash due to a faulty RAID controller and need to recover some e-mail (and possibly contacts) from a couple of mailboxes.
    My main concern is that my old .edb file is in a old forest that is different than my current forest. Due to the length of the old internal domain name having more than 15 characters (I previously migrated using a answer file) and my current internal
    domain name is 15 characters.local they are different.
    I also dont have the log files or STM file
    With the two internal domain names being different will I still be able to follow this related topic:
    http://social.technet.microsoft.com/Forums/zh/exchange2010/thread/8f4eb425-72ff-4d18-abfc-5c00be7113e2
    If not please let me know which direction I should be going. I know there are third part tools that can get this done but not in the budget right now.
    Teron

    Hi,Teron,
    Cross forest export mailbox is not possible,if you have the old forest server still running you can export the mailbox in the old forest to PST file then import the pst file to your current forest.
    Otherwise you should convert the edb file to PST with thirdparty tool as the above guys said.
    Some additional information just for your reference.
    http://social.technet.microsoft.com/Forums/en-US/exchange2010/thread/d731ac97-416b-4ff6-a4d9-861ce4345292
    http://social.technet.microsoft.com/Forums/en-US/exchangesvr3rdpartyappslegacy/thread/74233836-38d9-4682-81d2-7dd395066574
    Regards,
    Sharon
    Sharon Shen
    TechNet Community Support
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question.

  • Export mailboxes to PST (Exchange 2007)

    Hi All,
    Is there an 'export-mailbox' cmdlet I can use to export each of the mailboxes in our mailbox database using the following file name format, so that the full smtp address is used as the filename of each the PST file exported:
    [email protected]
    [email protected]
    etc, etc
    We are currently migrating to a cloud email provider and they have strict rules on processing PST files. The exchange database is only 65GB in size, so not that big in the grand scheme of things.
    Any help appreciated.
    Thanks.

    Untamed, you sure can.  Here's the original code I sent:
    Get-Mailbox -Database <databasename> | Sort name | % {
        $MbxSmtp = $_.PrimarySmtpAddress.ToString()
        Export-Mailbox $MbxSmtp -PstFolderPath "\\Servername\Share\$MbxSmtp"
    Note the first line, which ties the code to a single database.  You can change that line to focus on any group of mailboxes, even to a single mailbox.  Here's code for a single mailbox:
    Get-Mailbox <mailbox alias> | Sort name | % {
        $MbxSmtp = $_.PrimarySmtpAddress.ToString()
        Export-Mailbox $MbxSmtp -PstFolderPath "\\Servername\Share\$MbxSmtp"
    Here's code for an OU:
    Get-Mailbox -OrganizationalUnit <OU DN, as in "ADDomain.company.com/OURoot/SubOUName"> | Sort name | % {
        $MbxSmtp = $_.PrimarySmtpAddress.ToString()
        Export-Mailbox $MbxSmtp -PstFolderPath "\\Servername\Share\$MbxSmtp"

  • Export Mailbox to .PST

    Hello,
    I wish all contents(Send,Receive,..etc) older than '06/21/2014' from all mailboxes should be exported to pst.
    What to include additional to this cmdlet -
    New-MailboxExportRequest -Mailbox <alias>
    -FilePath "\\Server\ShareFolder\<alias>.pst"
    Please Guide.
    Few details-
    Name of Test mailbox - Demo
    Mailbox Created on 06/10/2014
    1) When I use the normal cmdlet,
    New-MailboxExportReuqest -Mailbox Demo -FilePath "\\Server's IP\ShareFolder\Demo.pst it generates a pst of
    1505 KB.
    2) When I use the cmdlet specifying today's date (For maximum output)
    New-MailboxExportReuqest -Mailbox Demo -ContentFilter {(Received -lt "07/23/2014")} -FilePath "\\Server's IP\ShareFolder\Demo.pst
    it generates a pst only of 265 KB. (It means something is wrong somewhere)
    3) Now the Strange thing is, the mailbox is created on 06/10/2014 (1.5 months old), when I use the cmdlet specifying the far previous date (3 months old)
    New-MailboxExportReuqest -Mailbox Demo -ContentFilter {(Received -lt "04/23/2014")} -FilePath "\\Server's IP\ShareFolder\Demo.pst
    it again generates a pst of 265 KB. (It means something is wrong somewhere again)
    Please Guide.
    Thanks, Divyaprakash Koli

    Hi,
    I tested in my lab, the result is the same with yours.
    I created a test mailbox, then I sent some messages to this mailbox and created some sub-folders under Inbox folder.
    Then I run the New-MailboxExportRequest cmdlet to export to .pst file with specifying the date, no items existed before this date.
    As a result, the size of this .pst file is 265KB which is the same with yours. I imported it to another new mailbox successfully, there were no items in this mailbox, but there were the same sub-folders under Inbox folder, the folder structure was the same.
    After that, I delete the sub-folders in the original mailbox, then exported to a .pst file, the size of this .pst file was still 265KB.
    Based on this test, it seems that the size of .pst file is a fixed value 265KB, if there are no items exported.
    Best regards,
    If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Belinda Ma
    TechNet Community Support

  • Export mailbox to pst from exchange 2010 shell - without calendar

    Is there a way to edit this command:
    New-MailboxExportRequest -Mailbox Kweku -IsArchive -FilePath "\\SERVER01\PSTFileShare\Kweku_Archive.pst"
    that it would export mailbox without calendars?
    with best regards,
    bostjanc

    You can use the -ContentFilter option to filter folders \ date
    Exchange Blog:
    www.ntweekly.com
    MCSA, MCSE, MCITP:SA, MCITP:EA, MCITP:Enterprise Messaging Administrator 2010,MCTS:Virtualization

  • Export-mailbox to PST file: unknown error in approving object

    Hi
    I'm trying to validate export/import of PST files with Ex2K7 SP1.
    I have this error during export-mailbox, and didn't find anything about it on the Net:
    [PS] C:\Documents and Settings\Administrator>Export-Mailbox user01 -PSTFol
    derPath C:\temp\
    Confirm
    Are you sure you want to perform this action?
    Exporting mailbox content from the mailbox 'user01' into .pst file
    'C:\temp\user01.pst'. This operation may take a long time to complete.
    Yes  Yes to All  No  [L] No to All  Suspend  [?] Help
    (default is "Y"):
    Export-Mailbox : Error was found for user01 ([email protected]
    ) because: Error occurred in the step: Approving object. An unknown error has o
    ccurred., error code: -2147221241
    At line:1 char:15
    + Export-Mailbox  <<<< user01 -PSTFolderPath C:\temp\
    I'm doing test on one virtual machine hosting AD (win2K3SP2 En), Ex2k7SP1 En, Outlook 2007 Fr.
    Could it come from the Outlook or user mailbox language ?
    The mailbox have been "initiated", I opened it with OWA, select French language, self sent message. I also opened it with Outlook 2007 on the server.
    Thanks.

    Hello,
           Details u needed.
    SUMMARY
    The Fixmapi.exe tool is included with Internet Explorer 5 & above to detect and aid in resolving conflicts with Messaging Application Programming Interface (MAPI) files that may affect your ability to send and receive mail and faxes from other programs.
    FixMAPI ( What Exactly it does ?).....
    Makes a backup copy of the current copy of mapi32.dll on the client computer, and restores mapi32.dll with the MAPI stub library, mapistub.dll.
    Quick Info
    Exported by:
    mapistub.dll
    Called by:
    Client
    Implemented by:
    Windows
    DWORD STDAPICALLTYPE FixMAPI(void);
    Return Values
    If the function succeeds, the return value is a non-zero value.
    If the function fails, the return value is zero. To get extended error information, call the Microsoft Platform Software Development Kit (SDK) function, GetLastError.
    Remarks
    FixMAPI does not replace the current mapi32.dll file if the file is marked as read-only.
    FixMAPI does not replace the current mapi32.dll if Microsoft Exchange Server is installed on the computer.
    When FixMAPI makes a backup copy of the current copy of mapi32.dll on the computer, it assigns the backup copy a name different from "mapi32.dll". It then directs subsequent calls intended for that assembly to the backup copy
    URL - > for u r more info. http://support.microsoft.com/kb/228457

  • Export mailbox to PST - Exchange 2007

    I ran this command on my Domain Admin Account from our 2007 Exchange Server 2007 w/ SP3:
    [PS] C:\Users\jesse\Desktop>Get-Mailbox | Add-ADPermission -User "jesse.Sams" -
    AccessRights GenericAll -ExtendedRights Send-As, Receive-As, MS-exch-store-admin
    When I run the command:
    Export-Mailbox –Identity <mailboxUser> -PSTFolderPath <pathToSavePST>
    -StartDate "<//span>08/29/12" –EndDate "08/29/12"
    -DeleteContent
    I get the error:
    Export-Mailbox : Error was found for First Name ([email protected]) because: Error occurred in the step: Moving messages. Failed to copy messages to the destination mailbox store with error: MAPI or an unspecified service provider.
    ID no: 00000000-0000-00000000, error code: -1056749164 At line:1 char:15 + Export-Mailbox <<<< 
    -Identity first.last -PSTFolderPath d:\archive -StartDate "08/29/12" -EndDate "08/29/12" -DeleteContent   
    + CategoryInfo         
    : InvalidOperation: (0:Int32) [Export-Mailbox], RecipientTaskException   
    + FullyQualifiedErrorId : 70397370,Microsoft.Exchange.Management.Recipient Tasks.ExportMailbox
    Any help on this issue would be greatly appreciated.
    Thanks, Jesse

    Hello jwmms,
    You can use this command to do that:
    Get-mailbox| add-mailboxpermission -user "jesse.sams" -AccessRights fullaccess
    Add-MailboxPermission
    http://technet.microsoft.com/en-us/library/bb124097(EXCHG.80).aspx
    Thanks,
    Evan Liu
    TechNet Subscriber Support in forum
    If you have any feedback on our support, please contact
    [email protected]
    Evan Liu
    TechNet Community Support

  • Executable or batch script for end users to export mailbox to PST

    We are in the process of taking over a small firm and proceeding with manual migration of mailboxes from this firm , currently we do not have full access to their environment and having a hard time depending on admins of their organization dealing over
    to exporting mailboxes and then importing them back to our exchange environment,  my idea is to rather provide a executable or batch script to user's of their organization get their mailboxes exported out directly from end users  so that we do not
    have to depend on remote organization's admins for every single user out there . is there a batch script or some executable code that end users can run to have their mailbox exported out directly ? 
    Aditya Mediratta

    Seems like, this informative article would be a good approach to resolve your concern :
    http://www.msexchange.org/articles-tutorials/exchange-server-2013/management-administration/managing-pst-import-export-process-exchange-server-2013-part2.html
    Moreover if you wish, you may also give a shot to this automated solution (http://www.exchangemailboxtopst.org/) in order to accomplish this job in more easier and quicker way.

  • Using PowerShell to auto archive exchange mailboxes to *.pst.

    I am trying to auto-archive terminated users' mailbox to *.pst using PowerShell.  I use the commandlet, New-MailboxExportRequest.  I then type in the the correct file path and mailbox name; however, I keep getting an error indicating that exchange
    could not find a database suitable to store my request.  Can someone please advise as to how I can remedy this error?  

    Hi,
    Please include the full command you ran and the full error text. Also, what version of Exchange are you running?
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • Import/Export mailbox - what is included by default?

    Hello! I think this is unclear in the documentation:
    Will a new export request export the complete mailbox by default? Included contacts, calendar, online archive?
    New-MailboxExportRequest -Mailbox Username -FilePath \\savelocation\username.pst
    Kthxbai

    Hi Kthxbai,
    The cmdlet below can take all folders and data in each and export it into the specified PST file. Also note that things such as the dumpster now can and by default will be exported.
    New-MailboxExportRequest –Mailbox HEW –FilePath \\Ex02\PSTFiles\HEW.pst
    For more detailed information to export mailbox to PST file, please go through this article:
    A look at the Import/Export Mailbox improvements in Exchange 2010 Service
    Pack 1 (Part 2)
    If there is anything else regsrding this matter, please feel free to post back.
    If you have any feedback on our support, please
    click here.
    Best Regards,
    Anna Wang
    TechNet Community Support

  • Export email to PST based on specified subject for all mailboxes using -ContentFilter Entered via a Read-Host variable

    I am attempting to recreate what we have done previously using exmerge under Exchange 2003 where we can archive out specific emails based on subject to pull out 0 days spam etc.  What I want to do first is to copy the mails to an individual .pst per
    user (in case we need to pull any emails back)
    I have manged to do this with using the following command (in this example extracting a subject containing the sub-phrase junktest):
    foreach ($mbx in (Get-Mailbox | Where {$_.ExchangeVersion.ExchangeBuild.Major -eq 14})) {New-MailboxExportRequest -Mailbox $mbx -ContentFilter {(subject -like "*junktest*")} -FilePath "\\ssf-adm-ex01\mailboxexport\$($mbx.Alias).pst"}
    I would like now to simplify the use of this so I am attempting to create a script where the user can input the emails Subject rather than having to edit the code each time.
    However I cannot get this to work. Using the following script it just exports emails with a subject line of $subjectstring rather than the variables content
    $subjectstring = Read-Host 'Please enter the Subject String'
    foreach ($mbx in (Get-Mailbox | Where {$_.ExchangeVersion.ExchangeBuild.Major -eq 14})) {New-MailboxExportRequest -Mailbox $mbx -ContentFilter {(subject -like "$subjectstring")} -FilePath "\\ssf-adm-ex01\mailboxexport\$($mbx.Alias).pst"}
    using the following just exports all of the emails from the server
    $subjectstring = Read-Host 'Please enter the Subject String'
    foreach ($mbx in (Get-Mailbox | Where {$_.ExchangeVersion.ExchangeBuild.Major -eq 14})) {New-MailboxExportRequest -Mailbox $mbx -ContentFilter {(subject -like $subjectstring)} -FilePath "\\ssf-adm-ex01\mailboxexport\$($mbx.Alias).pst"}
    I have tried all sorts of  combinations however I cannot get this to work correctly.
    Can anyone help a powershll newbie out?  Thanks in advance.

    Try:
    -ContentFilter "subject -like '$subjectstring'"
    No braces.  See what that does for you.
    This works like a dream.
    Thank you for your help,  it is appreciated.

  • Export Mailbox (POP3) Account from Cloud to PST

    Hello everyone,
    i am looking a PowerShell script to export mailbox account to pst file (Not From exchange or Office365).
    the mailbox account was in cloud, and i connecting useing pop3.
    this script need to be easy:
    Within the script I set up ones: mail server addresses, POP3 with SSL, Port Number.
    when i run the script i need to typed the MailAccount (before the @), It will add the extension automatically (example: domain.com)
    i need to type the password to mailbox
    he script will export all mail to file (the file was [MailBoxAccount].pst ).
    File destination is a network folder (A fixed location write down script).
    At the end it will write me the following information: exports of the box (box name) was successful.
    If you can write down the file size that would be great.
    I was looking for a great many sites on exports from the cloud information (not from Office 365) and found something that could really help me.
    Would love your help.
    Please Mark This As Answer if it helps to solve the issue
    Tzuri Ben Ezra | My Certifications:
    CompTIA A+ ,Microsoft MCP, MCTS, MCSA, MCITP
    |
    FaceBook: Tzuri FaceBook | vCard:
    Tzuri vCard | 
    Microsoft ID:
    Microsoft Transcript 
     |

    Hey Mike Laughlin,
    There are people with very great knowledge, not down from the level of knowledge of the consultant that sometimes is not objective (as it receives financial compensation from software to market).
    Maybe its a complex request, but still it is appropriate to ask in the forum because maybe there are people who engaged or know part of the solution or how to do this.
    For example:
    SMB business opened a mailbox for each employee a normal (organizational) in Gmail, whether he can export the data to PST file? The script should be pretty similar (only the server address & port was different).
    I am sure that the possibility exists, because Microsoft would prefer and promote the transfer of users to Exchange.
    Please Mark This As Answer if it helps to solve the issue
    Tzuri Ben Ezra | My Certifications:
    CompTIA A+ ,Microsoft MCP, MCTS, MCSA, MCITP
    |
    FaceBook: Tzuri FaceBook | vCard:
    Tzuri vCard | 
    Microsoft ID:
    Microsoft Transcript 
     |

  • Export list of Mailboxes to PST in Exchange Server 2010 -SP3 RU8v2.

    Hi Everyone.
    Every month we have to  export around 50 to100 mailbox to PST for users
    leaving process and the below command we use to export for each users manually.
    Command :
    New-MailboxExportRequest -Mailbox AylaKol -FilePath \\MBX-01\PSTFileShare\Ayla.pst
    I would like to export the list of  user's mailbox using a script and I got the below commands from another forum  and tried  to export with 2
    test mailboxs.
    Mailbox were queued as mentioned below,But the result is only one .pst file generate named ".PST".
    [PS] C:\>$Export = Get-Content .\Users\exadmin\Desktop\Mailbox.txt
    [PS] C:\>$Export|%{$_|New-MailboxExportRequest -FilePath "\\servername\D$\Export\PST\$($_.alias).pst"}
    Name                                       Mailbox
                                                            Status
    MailboxExport                         ch.india.com/Non ch accounts/Users/Ram...    Queued
    MailboxExport                         ch.india.com/Non ch accounts/Users/Kha...     Queued
    Please advise if I need to change any think in the command or kindly share any script
    Thanks.

    Hi Amjath,
    you can't use the previous automatic $_ variable behind a pipeline-"|". Here's a slight rewrite that ought to work:
    # Get list of Mailboxes
    $Export = Get-Content .\Users\exadmin\Desktop\Mailbox.txt
    # For each mailbox start an Export request
    foreach ($mb in $Export) { $mb | New-MailboxExportRequest -FilePath "\\servername\D`$\Export\PST\$mb.pst"}
    Cheers,
    Fred
    There's no place like 127.0.0.1

  • Export Mailbox permissions to CSV

    I am looking for a powershell script to export mailbox permissions. I have a list of accounts that I know are shared to other users but I want to be able to export all their permissions to a CSV so I can then replicate these permissions in Office 365. I
    have a script now that pulls every mailbox and its permissions but it is such a mess i would like to be able to pull a file much cleaner they what i have. 
    The one I have now is 
    Get-Mailbox  | Get-MailboxPermission | Select {$_.AccessRights}, Deny, InheritanceType, User, Identity, IsInherited, IsValid | Export-Csv D:\test_permission.csv
    I want to be able to only pull data from the list of mailboxes that i have, and only see accounts/groups that have full mailbox rights. If I could filter out system accounts that would be great as well. i tried modifying this script but had no such luck.
    Thanks!

    Hi,
    I have a test in my environment using Exchange 2010. You can use the following cmdlet Amit provided to find who has full mailbox access on one or more mailboxes in your environment and export the result to a CSV file.
    Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission | Where {$_.user -notlike "NT AUTHORITY\SELF" -and $_.IsInherited -eq $false} | Select Identity,User,@{Name='Access Rights';Expression={[String]::join(‘, ‘, $_.AccessRights)}} | Export-Csv C:\MailboxAccess.csv
    -NoTypeInformation
    Please change the "C:\MailboxAccess.csv " to the location that you use to save this .csv file.
    Hope it helps.
    Best regards,
    Amy Wang
    TechNet Community Support

  • I am using an expense tracker and when I export the file for use it says it is in location /var/mobile/applications/666E-4BC6-8FF1-50CAD35FA541/documents/MyExpenses.csv where do I find this? Assistance greatly appreciated

    I am using an expense tracker and when I export the file for use it says it is in location /var/mobile/applications/666E-4BC6-8FF1-50CAD35FA541/documents/MyExpenses.csv where do I find this? Assistance greatly appreciated

    Attached is Dennis Linam’s Audition – “Log File” and “Log – Last File”
    Contact information Dennis [email protected]
    Previous contact information with your organization (DURIM):
    Dennis - i just finished my audition trial and bought the subscription the 2014 version.
    created by durin in Audition CS5.5, CS6 & CC - View the full discussion 
    DURIM - Okay.  I would expect the "Cache Warning" message because your default directories would not be the same as the ones in the settings file I generated.
    If you go back to the "7.0" directory and open the "Logs" folder, can you copy the "Audition Log.txt" file and send it as an attachment to [email protected]?  We'll take a look in that logfile and see if it gives us more information about why this is failing now.
    Also, do you have any other Adobe applications installed on this machine, such as Premiere Pro?  If so, do they launch as expected or fail as well?
    I do have the trial Pro version of Adobe reader, but I have not activated it, because I fear the same thing will happen did it. I cannot afford to activate the subscription for that product and take the chance of it not working either. I depend on those two programs religiously. Here is the files that you requested. I appreciate any help you can give me to get this audition program started
    Audition Log- file
    Ticks = 16       C:\Program Files (x86)\Common Files\Adobe\dynamiclink\7.0\dynamiclinkmanager.exe
    Sent from Windows Mail

Maybe you are looking for

  • Alternative way to create delivery for STO

    Hi all, Is there an alternative way to create a delivery for STO aside from going to tcode VL04? Thanks!

  • Issue on Payment statement for customer

    Hi, I am not sure what is the customer payment statement process. Now I have a scenario: One sales order have one sold -to party ,one ship-to party,one bill-to party, one payer and one payment statement receiver  with partner function. As I known,the

  • Visual Studio 2010 64bit cann't connect Oracle database through 64bit ODBC Driver

    Hi, I am developing an 64bit And-In software. My OS is windows7 64bit Ultimate. Developer tool is Microsoft  Visual Studio 2010 Ultimate 64bit any-CUP. Server is SUN server and Oracle database 10.2.0.5 64bit enterprise edition. I have installed insta

  • Play sound the first time only

    Hello I have an As3 simple game with navigation buttons. It starts off with short intro with sound. When the game loads and the player dies it goes to retry screen with button which when is pressed goes back to the game. The problem is that when that

  • Assign Order type to Plant

    Hi All, Can you please help me understand if there is some config setting to assign Oprder type to Plant?? If yes where in SPRO can i find this? Regards, Jatinder