exporting mailboxes to PST using exchange 2007 shell
HiWe are in the process of deleting legacy emails using powershell (any emails before 2008 will be deleted using a script). There is a command I have been attempting to use to export all staff mailboxes onto my local machine just as backup in case things go wrong but seem to be hitting a brick wall. I have tried two different methods to extract mailboxes into PST but I seem to be having some sort of permission issue I think. The first cmd I have run is:Get-Mailbox -Database "name of exchange server\Mailbox Database" | Export-Mailbox -PSTFolderPath F:\PSTsThis cmd seems to run and a pst file is created for every user into the folder I specify but the size is always 265kb.I have also tried to run the command based on a organisational unit called staff but it gives me the following error. It says specify a unique value but that OU is unique, I do have other OU's called 'teaching staff' 'office staff' so not sure if this is what it means. Question is how do I ensure I run the command so it is unique?[PS] F:\Documents and Settings\administrator>Get-Mailbox -OrganizationalUnit Staff | Export-Mailbox -PSTFolderPath f:\PSTsThere are multiple organizational units matching the identity "Staff". Please specify a unique value.At line:1 char:1+ G <<<< et-Mailbox -OrganizationalUnit Staff | Export-Mailbox -PSTFolderPath f:\PSTs[PS] F:\Documents and Settings\administrator>Get-Mailbox -OrganizationalUnit Staff | Export-Mailbox -PSTFolderPath f:\PSTsThere are multiple organizational units matching the identity "Staff". Please specify a unique value.At line:1 char:1+ G <<<< et-Mailbox -OrganizationalUnit Staff | Export-Mailbox -PSTFolderPath f:\PSTsI thought the issue may be to do with permissions and found an article which mentioned to check to see if the account I was using had exchange organisation admin rights and local admin rights (I was using the domain administrator account) which had these permissions but still had problems. Whilst it was attempting to export the mailboxes I also received the following error: Error was found for Staff name (staff email address) 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 (Export-Mailbox) At line: 1 If anyone has run into these same issues and have found a cure please advise on what I could try that would really help.Thank
August 26th, 2009 12:27pm

I would say create a normal domain user account rather than using Domain admin account as they have deny rights on org wide. below is the method to create a dedicated account only to perform the exmerge operation. Get-MailboxDatabase -Server EX2007" | Add-ADPermission -User exmergeuser -ExtendedRights Receive-As Try the command in below format for OU Get-Mailbox OrganizationalUnit ou=Accounting,ou=Structure,dc=mydomain,dc=local export-mailbox SubjectKeywords Payroll PstFolderPath c:\MyPSTs DeleteContent confirm:$false Vinod |CCNA|MCSE 2003 +Messaging|MCTS|ITIL V3|
Free Windows Admin Tool Kit Click here and download it now
August 26th, 2009 1:03pm

Thank you that worked, I knew it would be some sort of permissions issue.I tried exporting mailboxes via the OU and that also worked as you mentioned. Thanks
August 27th, 2009 12:06pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics