Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 501261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:10:17+00:00 2026-05-13T06:10:17+00:00

I’ve got an issue with using Export-Mailbox cmdlet in Powershell to delete emails between

  • 0

I’ve got an issue with using Export-Mailbox cmdlet in Powershell to delete emails between two dates from a mailbox. The current code that I am running is:

Export-Mailbox -Identity mailboxname -StartDate "01/11/2009 00:00:01" -EndDate "14/11/2009 00:00:01" -DeleteContent

I know there are emails that fall between these two dates, but every time the command runs and completes but gives a status message of “Error occurred in the step: Moving messages. Failed to copy messages to the destination mailbox store with error: An unknown error has occured.”

Has any had success with using Export-Mailbox to delete messages, or know why this is erroring out?

Thanks.

  • Jonny

~~~ SOLUTION ~~~

Using the help from David I ran the command again as follows:

Get-Mailbox -Identity jonny | Export-Mailbox -TargetMailbox target -TargetFolder folder -EndDate "14/11/09 00:01:00" -StartDate "14/11/09 00:00:00" -DeleteContent

This worked as long as there weren’t any more than 3000 emails in that timespan.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:10:18+00:00Added an answer on May 13, 2026 at 6:10 am

    Try:

    Get-Mailbox -Identity Jonny | Export-Mailbox -TargetMailbox mailboxname -StartDate "01/11/2009 00:00:01" -EndDate "14/11/2009 00:00:01" -DeleteContent
    

    See this for more info about the most common problems using Export-Mailbox:

    The most common problems with using
    Export-Mailbox are related to
    permissions. To use Export-Mailbox
    you need to be delegated the Exchange
    Server Administrator role, be a member
    of the local Administrators group for
    the target server, and have full
    access to the source and destination
    mailboxes. The source and destination
    mailboxes must be in the same Active
    Directory forest.

    These are some common
    permissions-related errors:

    ERROR

    • The specified mailbox database [Mailbox Database Name] does not exist

    CAUSE The user running the Export-Mailbox command needs to be
    delegated the Exchange Administrator
    role for the Exchange server.

    ERROR

    • Error occurred in the step: Creating target folder in the target mailbox. An unknown error has occurred., errorcode: -2147221233

    CAUSE
    The user running the Export-Mailbox does not have full access to the destination mailbox.

    ERROR

    • 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”

    CAUSE
    The user running the Export-Mailbox does not have full
    access to the destination mailbox.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 341k
  • Answers 341k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You can issue an AJAX request to the new page… May 14, 2026 at 4:55 am
  • Editorial Team
    Editorial Team added an answer API Reference List of all events (with demo) May 14, 2026 at 4:55 am
  • Editorial Team
    Editorial Team added an answer Yes, it is sufficient to prevent Cross Site Request Forgery.… May 14, 2026 at 4:55 am

Related Questions

I've got a string that has curly quotes in it. I'd like to replace
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into
I have text I am displaying in SIlverlight that is coming from a CMS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.