Asked by:
search-mailbox cmdlet not found in exchange 2010

Question
-
Dear Exchange administrators,
We need to delete "some messages" from all user inboxes send by the account "postmaster".
Get-Mailbox -ResultSize unlimited | Search-Mailbox -SearchQuery subject:"search string" -targetmailbox postmaster -targetfolder inbox\search2 –deletecontent
But I am getting "search-mailbox" command not found.
How will get this command.
Kindly help
Regards
Ashraf
AshrafWednesday, December 28, 2011 11:49 AM
All replies
-
Hi Ashraf,
You need permissions for search-mailbox to work and cmdlet to be visible. Add yourself as a member of the group "Discovery Management" and it should work for you.Messaging Policy and Compliance Permissions
http://technet.microsoft.com/en-us/library/dd638205.aspx
Martina Miskovic - http://www.nic2012.com/Wednesday, December 28, 2011 12:44 PM -
Please check this link
http://technet.microsoft.com/en-us/library/dd298173.aspx
Additional Permissions needed for Parameter -DeleteContent EditTo be able to use the -DeleteContent Parameter you need to have "Mailbox Import Export" permissions. Without these permissions, the parameter -DeleteContent is not available for the Search-Mailbox Command.
Instructions:
1. Create a new Security Group
2. Enter the following command in Exchange Management Shell (replace the Security Group name accordingly):
New-ManagementRoleAssignment -Name "Import Export Support" -SecurityGroup ImportExport -Role "Mailbox Import Export"
regards sameerWednesday, December 28, 2011 1:28 PM -
hi,
you can see this link:http://social.technet.microsoft.com/Forums/en-US/exchange2010/thread/2cc0c3df-cd5e-4c13-9193-9ba6141a8d0c/.The problem is familiar with yours.Hope can help you.
thanks,
castin
Thursday, December 29, 2011 6:17 AM -
hi,
any update?
thanks,
castin
Tuesday, January 3, 2012 7:01 AM -
it is not resolved yet
AshrafTuesday, January 3, 2012 7:20 AM -
hi,
Have you try the way that we post.Have you used the cmd search-mailbox before,can it work,or this is your first useing the cmd search-mailbox?If you try our way and it still not work.My suggestion is you can install the managment tool in another computer and try again.How to install you can see:http://technet.microsoft.com/en-us/library/bb232090.aspx
- Edited by Castinlu Wednesday, January 4, 2012 1:40 AM
Wednesday, January 4, 2012 1:20 AM -
hi,
how about you issue?any update?
thanks,
castin
Monday, January 9, 2012 1:57 AM