Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Error running Search-Mailbox Query Exchange Management Shell

Posted on 2013-11-26
3
Medium Priority
?
1,754 Views
Last Modified: 2013-11-26
I am trying to run a powershell commandlet from the Exchange Management shell, I have Exchange 2010.

This is the command:
Search-Mailbox -Identity "<user>" -SearchQuery 'Subject:"<subject_title>"' -DeleteContent

my respoinse is always:

A positional parameter cannot be found that accepts argument '-DeleteContent'.
    + CategoryInfo          : InvalidArgument: (:) [Search-Mailbox], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Search-Mailbox

I do not know what I am doing wrong. All  my research suggests that this should work.
0
Comment
Question by:sattermc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Accepted Solution

by:
J S earned 2000 total points
ID: 39679264
Have you assigned the account running this command the "Mailbox Import Export" role?
0
 
LVL 12

Expert Comment

by:David Paris Vicente
ID: 39679479
Hi sattermc.

This problem happens because your account is not a member of the Discovery Management role. Since your account does not have permission to perform searches, Powershell does not import the Search-Mailbox cmdlet.

In ECP, add the account to this role, then close and restart your Powershell session.
0
 

Author Comment

by:sattermc
ID: 39679502
The problem was the "Mailbox Import Export" role.

Thank you both.
0

Featured Post

Q2 2017 - Latest Malware & Internet Attacks

WatchGuard’s Threat Lab is a group of dedicated threat researchers committed to helping you stay ahead of the bad guys by providing in-depth analysis of the top security threats to your network.  Check out our latest Quarterly Internet Security Report!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Want to know how to use Exchange Server Eseutil command? Go through this article as it gives you the know-how.
On September 18, Experts Exchange launched the first installment of the Help Bell, a new feature for Premium Members, Team Accounts, and Qualified Experts. The Help Bell will serve as an additional tool to help teams increase question visibility.
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question