ful56_uk Posted March 12, 2012 Posted March 12, 2012 hello been trying to remove a message from all of our students mailboxes which one of the darlins sent out. where on sp1 2010 exchange but I cant seem to get the code to work and my heads hurting now with Power shell. Trying to do it for the body of the email too. Get-MailboxDatabase -identity "Student Database" | Search-Mailbox -SearchQuery 'Subject:"ENTER TEXT HERE"' -DeleteContent
sonofsanta Posted March 12, 2012 Posted March 12, 2012 Well I did this on 2007 but presumably the cmdlets will work the same in 2010. Learnt the Hard Way: How to Forcibly Remove Messages in Exchange - Blogs - EduGeek.net get-mailbox -Database Student | Export-Mailbox -SubjectKeywords "SUBJECT QUERY HERE" -StartDate "DD/MM/YYYY" -DeleteContent That will ask for a target mailbox and folder so give it your own or an itsupport mailbox and it copies the content over; that way you can see who has read the message or not (if you can be bothered to dig through them all!) EDIT to say I'm guessing the name of your student database there, obviously. Replace the word "student" with whatever is appropriate.
ful56_uk Posted March 13, 2012 Author Posted March 13, 2012 I get the error The term 'Export-Mailbox' is not recognized as the name of a cmdlet, I think they made changes in 2010 sp1.
Arthur Posted March 13, 2012 Posted March 13, 2012 (edited) Do you have the Mailbox Import Export RBAC role assigned to the user account you using? If not, that could be why it isn't working. New-ManagementRoleAssignment –Role "Mailbox Import Export" -User Administrator Edited March 13, 2012 by Arthur
Jonah Posted March 13, 2012 Posted March 13, 2012 The command is now New-ExportMailboxRequest, as well as ensuring you have the role above^
Arthur Posted March 13, 2012 Posted March 13, 2012 The command is now New-ExportMailboxRequest I thought New-MailboxExportRequest was just for exporting mailboxes to PSTs? Surely it's the Search-Mailbox cmdlet you need? Search-Mailbox -Identity JaneDoe -SearchQuery "Subject:'free iPad'" -DoNotIncludeArchive -SearchDumpster:$false -DeleteContent -Force Get-Mailbox -ResultSize Unlimited | Search-Mailbox -SearchQuery 'from:[email protected]' -DeleteContent -Force
sukh Posted March 14, 2012 Posted March 14, 2012 Search-Mailbox is the command that you now use not the export cmdlet. Search For and Delete Messages from Users' Mailboxes
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