MSExchangeGuru.com

Learn Exchange the Guru way !!!

 

Export Contacts folder to a PST in Exchange 2007

Is it possible to export items of a particular folder in the mailbox to a PST rather than having the entire mailbox exported? Yes, indeed. However, it cannot be directly exported to a PST. It can only be exported to another user mailbox that has full access of the mailbox.

Scenario:

User A would like to have an export of the contacts folder in User B’s mailbox. This can be run from the server by following the steps below:

  1. Provide full permission to User A to access User B’s mailbox:

    From the Exchange powershell, run the script below to provide full mailbox access to UserA on UserB’s mailbox

    Add-MailboxPermission -Identity UserB -User UserA -AccessRights FullAccess

  • Please note that UserA and UserB in the above command are aliases for the User mailboxes.

The powershell window indicates the screen below:

[PS] C:\Documents and Settings\admin>Add-MailboxPermission -Identity UserB -User UserA -AccessRights FullAccess

Identity                 User                   AccessRights        IsInherited     Deny

——–                   —-                       ————            ———–        —-

Domain\User…      Domain\UserA      {FullAccess}         False                False

  1. Export the required folder to a specific folder in another user mailbox

Once the required access has been provided, run the export mailbox command indicated below:

Export-Mailbox -Identity UserB -IncludeFolders ‘\Contacts’ -TargetFolder Backup -TargetMailbox UserA

  • Please note that UserA and UserB in the above command are aliases for the User mailboxes.
  • The parameter Contacts will exports contents from the Contents Folder in UserB’s mailbox. This can be replaced with Inbox, Sent Items, Drafts, Calendar etc.
  • The parameter Backup is a Folder that will be created in UserA’s mailbox. This folder can be expanded from UserA’s mailbox to view the Contacts folder that has been exported from UserB’s mailbox.

The powershell window indicates the screen below:

Identity : Domain.com/OU/UserB
DistinguishedName :CN=UserB,CN=OU,DC=Domain,DC=com
DisplayName :User B
Alias :UserB
LegacyExchangeDN :/o=Domain/ou=Users/cn=Recipients/cn=UserB
PrimarySmtpAddress :UserB@domain.com
SourceServer :Server Name
SourceDatabase :Server Name\Storage Group Name\Database Name
SourceGlobalCatalog :Global Catalogue Name
SourceDomainController :
TargetGlobalCatalog :Global Catalogue Name
TargetDomainController :
TargetMailbox : Domain.com/OU/UserA
TargetServer :Server Name
TargetDatabase :Server Name\Storage Group Name\Database Name
MailboxSize :Size of the mailbox
IsResourceMailbox :False
Options : Default
TargetFolder :\Backup\Recovered Data – UserB – Date Time
PSTFilePath :
MoveType :Export
MoveStage :Completed
StartTime :Start Date and Time
EndTime :Finish Date and Time
StatusCode :0
StatusMessage : This mailbox has been exported to the target user mailbox.

Once the command completes successfully, you can view a folder named as Backup in the root of the mailbox for UserA and the below details will be visible in the Outlook of UserA:


If this needs to extracted to a PST, you can export the details to a PST Folder from Outlook.


Meera Nair
Team@ MSExchangeGuru

5 Responses to “Export Contacts folder to a PST in Exchange 2007”

  1. Anand Kumar Deva Says:

    Cool. The situation you are explaining to me is new [atleast to me!], instead of contacts you would’ve mentioned about a folder export. Anyway, good job…

  2. Alton Brisbane, Jr. Says:

    I have tried this process repeatedly with no success yet. (But will keep trying) I am either unable to create the target folder or unable to move the messages. Any suggestions on what I may be doing wrong?

    [PS] C:\Documents and Settings\Administrator.INDHOIST\desktop\contactlist>Add-Ma
    ilboxPermission -Identity ‘Alton Test’ -User ‘Administrator’ -AccessRights FullA
    ccess
    Identity User AccessRights IsInherited Deny
    ——– —- ———— ———– —-
    industrialhoist.l… INDHOIST\administ… {FullAccess} False False

    [PS] C:\Documents and Settings\Administrator.INDHOIST\desktop\contactlist>Get-Co
    ntent List.txt | Export-Mailbox -IncludeFolders ‘\Contacts’ -TargetFolder ‘Backu
    p’ -TargetMailbox ‘Alton Test’

    Export-Mailbox : Error was found for Barry Bergeron (bbergeron@deltarigging.com
    ) 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:38
    + Get-Content List.txt | Export-Mailbox <<<< -IncludeFolders '\Contacts' -Targ
    etFolder 'Backup' -TargetMailbox 'Alton Test'
    + CategoryInfo : InvalidOperation: (1:Int32) [Export-Mailbox], Re
    cipientTaskException
    + FullyQualifiedErrorId : 36EA04D8,Microsoft.Exchange.Management.Recipient
    Tasks.ExportMailbox

    Export-Mailbox : Error was found for Vernon Carrere (vcarrere@deltarigging.com)
    because: Error occurred in the step: Creating target folder in the target mail
    box. Failed to create folder 'Recovered Data – Vernon Carrere – 5/11/2011 12:19
    :29 PM' in the target mailbox with error: An unknown error has occurred., error
    code: -1056749114
    At line:1 char:38
    + Get-Content List.txt | Export-Mailbox <<<< -IncludeFolders '\Contacts' -Targ
    etFolder 'Backup' -TargetMailbox 'Alton Test'
    + CategoryInfo : InvalidOperation: (2:Int32) [Export-Mailbox], Re
    cipientTaskException
    + FullyQualifiedErrorId : 9247CAEF,Microsoft.Exchange.Management.Recipient
    Tasks.ExportMailbox

  3. Patrick Says:

    Alton Brisbane, Jr It seems the user you are using doesnt have rights. You need to be a high level admin and give yourself rights to the mailbox to perform these actions and you must log on as the user you set to have FullAccess permissions to or it wont work

  4. David Says:

    Works well. Is there anyway to not require the “recovered Data” folder? My scenario is I need to consolidate the personal Contactcs for 100’s of mailboxes into 1 address book. This gets me halfway there but I have the “Recovered Data – Mailbox Name” folder for each and every mailbox under my backup folder. I need a way to export all contactcs for all mailboxes into 1 folder\csv file if possible?

  5. Renato Says:

    I´m trying to export to a .PST file but without success. Take a look at my post on Technet:
    http://social.technet.microsoft.com/Forums/en-US/exchangesvradmin/thread/c7a9425f-016c-4402-92ee-8757827a1fd9

Leave a Reply

Categories

Archives

MSExchangeGuru.com