BassTech Posted January 5, 2016 Posted January 5, 2016 I'm trying to delete all Inbox, Sent Items & Deleted Items from our student mailboxes, this is the command I'm trying to run: Get-MailboxDatabase “Students Database” | Export-Mailbox -TargetMailbox TESTSTUDENT -IncludeFolders "\Inbox" "\Sent Items" "\Deleted Items" -DeleteContent All students have their own database so I've specified that, I'm trying it with just our TESTSTUDENT account first as a test, but powershell keeps throwing the error: [PS] C:\Documents and Settings\Administrator.DOMAIN\Desktop>Get-MailboxDatabase "Students Database" | Export-Mailbox -TargetMailbox TESTSTUDENT -IncludeFolders "\Inbox" "\Sent Items" "\Deleted Items" -DeleteContent Export-Mailbox : A positional parameter cannot be found that accepts argument ' \Deleted Items'. At line:1 char:57 + Get-MailboxDatabase "Students Database" | Export-Mailbox <<<< -TargetMailbox TESTSTUDENT -IncludeFolders "\Inbox" "\Sent Items" "\Deleted Items" -DeleteCon tent + CategoryInfo : InvalidArgument: ( : ) [Export-Mailbox], Parameter BindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.Exchange.M anagement.RecipientTasks.ExportMailbox The permissions are defiantly correct, I'm wondering if anyone can spot anything wrong in my script? Thanks!
HPlum78 Posted January 5, 2016 Posted January 5, 2016 Seems it cannot find the TESTSTUDENT mailbox should it not be export-mailbox -identity teststudent@.......
BassTech Posted January 6, 2016 Author Posted January 6, 2016 (edited) I've found a different way of doing it now, using this command: Get-Mailbox -OrganizationalUnit Students -Identity teststudent | Export-Mailbox -DeleteContent which seems to work Edited January 6, 2016 by BassTech
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now