Error deleting emails from another user's mailbox

I have a user that is waaaay over her limit so I trying to empty her deleted and sent items. I ran the following shell command:
export-mailbox -identity "heather" -includefolders "\deleted items" -deletecontent
But got the following error:

Export-Mailbox : Error was found for Heather Whitley (Heather@taylorrealestate.
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:15
+ export-mailbox <<<<  -identity "heather" -includefolders "\deleted items" -deletecontent
    + CategoryInfo          : InvalidOperation: (0:Int32) [Export-Mailbox], Re
    + FullyQualifiedErrorId : DE389E14,Microsoft.Exchange.Management.Recipient
Who is Participating?

Improve company productivity with a Business Account.Sign Up

EMJSRConnect With a Mentor Commented:
Is your server 64-bit? There were several articles that state that export like this only works on 32-bit systems. This may have been patched.

Also have a look through this article. It may still be a rights issue, but on another level:

Also, when you export the mailbox and can specify a target folder, I would always go with a folder that is not governed by the OS, e.g. not somewhere in %programfiles%.

Another suggestion, is UAC turned off on the client machines and on the server?
You didn't say which version of Exchange you're running, but this or a similar error was, I believe, solved in the Exchange 2007 update roll-up 4 for Exchange 2007 SP1.

A simpler solution could also be to check the access rights. Does your account have "Full Access Permission" to Heather's mailbox?

You can use the following Shell command:

Add-MailboxPermission –Id <UserMailbox> –User <Account to have permissions> –AccessRights ‘Full Access’ –Confirm:$false

Open in new window

xzay1967Author Commented:
Thank you for quick response, the Exchange version is 2007, this is actually SBS2008 with Exchage 2007 integrated. I ran your command which yielded the below result.

Identity             User                 AccessRights        IsInherited Deny
--------             ----                 ------------        ----------- ----
wtaylor.local/MyB... WTAYLOR\zay          {FullAccess}        False       False

So, I ran the export command again, and got

export-mailbox -identity "heather" -includefolders "\deleted items" -deletecontent

Cannot open the log file 'C:\Program Files\Microsoft\Exchange Server\Logging\Mi
At line:1 char:1
+  <<<< export-mailbox -identity "heather" -includefolders "\deleted items" -de
    + CategoryInfo          : InvalidOperation: (:) [], InvalidOperationExcept
    + FullyQualifiedErrorId : 964C95C
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Does the user have Local Administrator rights on the client workstation?

Start > Run > control userpasswords2

Add the user if not listed, so the User Name corresponds to her user account and the Domain to your Windows domain name (you don't need to add .local or .com or w/e you have) and the Group should be Administrator.

You probably know how to do this, but I figured just in case!
xzay1967Author Commented:
The user has local admin rights to all the workstations. This is a real estate company so no user has a designated machine. The environment is sbs2008 with redirected folders enabled so the users' documents follows them to whatever workstation they log onto. I running the shell command on the server, so not sure how or where the user's local admin rights come into play. Not disputing, just trying to understand the logic.  I really need to get this done, cause right now when I run a get-mailboxstatistics <username> I get maildisabled for the status. I know this is due to her being well over her limit. I increased her mailbox for the time being so she can at least log on and manually delete her stuff. But I don't want this to the fix all be all method.
The user admin rights come to play with anything you do in Outlook. For example in Outlook 2010 when you try and import old NK2 files using a command line trigger, unless the user has local admin rights, it won't work. We have done extensive testing in that regard.

But since that's not it, I'll have to get back to you.
xzay1967Author Commented:
I think I know what the issue is, I should be running this from a workstation rather than the server. After reading your comments, it dawned on me I shouldn't be doing it from the server. I will download and install the management tools and see how that works.
Well that is a possibility. You could simply delete emails directly from her Outlook and/or export the PST from there, too.

I just didn't know which route you preferred and/or which kind of access you have. I do a lot of remote support, even though I'm in the same city as most of our clients. Always depends on your setup.
xzay1967Author Commented:
Yeah I could go the Outlook way, but I try to approach or resolve issues from an Admin stand point lol. I also like the challenge of using PS that way I can become better. I must be having a brain fart, cause I performed the same task some time ago, when I moved an entire office's email by exporting their pst using PS. Two partners fell apart, so when one left, some agents left with her, so I had to move their emails to the new office.
xzay1967Author Commented:
I ran the command from a workstation, and it ran flawlessly. I totally forgot that I needed to do that from the workstation.
That's OK, believe me I've been there. It's the moment when you know how you have seen something before, but you can't quite pinpoint it.

Plus, while using command line is kinda fun (and a certain level of nostalgia) and while I understand Microsoft's desire to not make admin tasks all too accessible, so that not every Joe Shmuck can pretend to be a sysadmin, I do believe they could make the entire process a little less time consuming.

For example, how about mounting a mailbox store to the NTFS filesystem to either read and/or export/import. Backup software can do that, so... But hey.

Anyway, glad I could point you in the right direction!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.