Solved

Error running Search-Mailbox Query Exchange Management Shell

Posted on 2013-11-26
3
1,640 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 500 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

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

In-place Upgrading Dirsync to Azure AD Connect
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
how to add IIS SMTP to handle application/Scanner relays into office 365.

696 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