Quantcast
Channel: PowerShell General
Viewing all articles
Browse latest Browse all 10624

Exchange 2010 Search-Mailbox Issue

$
0
0

I am having a problem getting "Search-Mailbox -SearchQuery" to accept a variable.

There are examples in the script on how to properly format the query (not shown here).

The problem appears to be the variable ($query) is not recognized by the
CMDLET search-mailbox.  Do you have any suggestions?

$query=read-host "enter your query"

get-mailbox -resultsize unlimited |Search-Mailbox  -SearchQuery '$query' -searchdumpster         -targetmailbox "mailbox name" -targetfolder "folder name" -loglevel full

Dale


Viewing all articles
Browse latest Browse all 10624

Trending Articles