I'm trying to delete 48000 emails within the "Inbox" folder of a specific mailbox called "GTV Info". I only want to delete all the emails within the "Inbox" folder and keep the "Inbox" folder empty.
Exchange Server 2007 SP1 08.01.0436.000
I'm issuing this command, and this is the error message that I'm getting:
[PS] C:\Windows\system32>Export-Mailbox -Identity "GTV Info"
-IncludeFolders "\Inbox" -StartDate "16/11/2009" -EndDate "24/08/2011" -DeleteContent
Confirm Are you sure you want to perform this action? Searching the contents and/or the associated messages from the mailbox 'GTV Info' and deleting those messages that meet the criteria specified. This operation may take a long time to complete. [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):A Export-Mailbox : Error was found for GTV Info (info@gt-vehicles.com) because: E rror occurred in the step: Moving messages. Failed to copy messages to the dest ination 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 "GTV Info" -IncludeFolders "\Inbox" -StartDate "16/11/2009" -EndDate "24/08/2011" -DeleteContent
+ CategoryInfo : InvalidOperation: (0:Int32) [Export-Mailbox], Re cipientTaskException
+ FullyQualifiedErrorId : 35CD2975,Microsoft.Exchange.Management.Recipient Tasks.ExportMailbox
Identity : gtv.local/MyBusiness/Users/SBSUsers/GTV Info DistinguishedName : CN=GTV Info,OU=SBSUsers,OU=Users,OU=MyBusine
ss,DC=gtv,DC=local DisplayName : GTV Info Alias : info LegacyExchangeDN : /o=First Organization/ou=Exchange Administra
tive Group (FYDIBOHF23SPDLT)/cn=Recipients/c
n=info PrimarySmtpAddress : info@gt-vehicles.com SourceServer : SAGITARIUS.gtv.local SourceDatabase : SAGITARIUS\First Storage Group\Mailbox Datab
ase SourceGlobalCatalog : SAGITARIUS SourceDomainController : TargetGlobalCatalog : SAGITARIUS TargetDomainController : TargetMailbox : TargetServer : TargetDatabase : MailboxSize : 1928KB IsResourceMailbox : False SIDUsedInMatch : SMTPProxies : SourceManager : SourceDirectReports : SourcePublicDelegates : SourcePublicDelegatesBL : SourceAltRecipient : SourceAltRecipientBL : SourceDeliverAndRedirect : MatchedTargetNTAccountDN : IsMatchedNTAccountMailboxEnabled : MatchedContactsDNList : TargetNTAccountDNToCreate : TargetManager : TargetDirectReports : TargetPublicDelegates : TargetPublicDelegatesBL : TargetAltRecipient : TargetAltRecipientBL : TargetDeliverAndRedirect : Options : DeleteSourceContent SourceForestCredential : TargetForestCredential : TargetFolder : PSTFilePath : RsgMailboxGuid : RsgMailboxLegacyExchangeDN : RsgMailboxDisplayName : RsgDatabaseGuid : StandardMessagesDeleted : 0 AssociatedMessagesDeleted : 0 DumpsterMessagesDeleted : 0 MoveType : DeleteOnly MoveStage : Move StartTime : 26/08/2015 13:12:15 EndTime : 26/08/2015 13:12:16 StatusCode : -1056749164 StatusMessage : 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 ReportFile : C:\Program Files\Microsoft\Exchange Server\L
ogging\MigrationLogs\export-Mailbox20150826-
131211-5306000.xml
[PS] C:\Windows\system32>
I'm very stuck with this, I really need help from this awesome community.
In your command you are missing a destination to export the e-mails to.
Your not working command:
Export-Mailbox -Identity "GTV Info" -IncludeFolders "\Inbox" -StartDate "16/11/2009" -EndDate "24/08/2011" -DeleteContent
With a destination defined it looks like this:
Export-Mailbox -Identity "GTV Info" -IncludeFolders "\Inbox" -StartDate "16/11/2009" -EndDate "24/08/2011" -DeleteContent -PSTFolderPath 'C:\PSTFiles\Mails.pst'
See here for examples and here for more info on the available parameters.