Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Error deleting emails from another user's mailbox

Posted on 2013-02-01
Medium Priority
Last Modified: 2013-02-02
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
Question by:xzay1967
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5

Expert Comment

ID: 38845639
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


Author Comment

ID: 38845678
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

Expert Comment

ID: 38845725
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!
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.


Author Comment

ID: 38845876
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.

Expert Comment

ID: 38846005
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.

Accepted Solution

EMJSR earned 2000 total points
ID: 38846016
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?

Author Comment

ID: 38846050
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.

Expert Comment

ID: 38846124
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.

Author Comment

ID: 38846727
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.

Author Comment

ID: 38846795
I ran the command from a workstation, and it ran flawlessly. I totally forgot that I needed to do that from the workstation.

Expert Comment

ID: 38847123
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!

Featured Post

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
New style of hardware planning for Microsoft Exchange server.
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question