Solved

Error running Search-Mailbox Query Exchange Management Shell

Posted on 2013-11-26
3
1,542 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
3 Comments
 
LVL 6

Accepted Solution

by:
jasons73 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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

This article will help you understand what HashTables are and how to use them in PowerShell.
Scam emails are a huge burden for many businesses. Spotting one is not always easy. Follow our tips to identify if an email you receive is a scam.
In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

809 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