Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted (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 by Arthur
Posted
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? :confused:

 

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...