Solved

Powershell Command 'Where' clause issue

Posted on 2014-01-08
8
702 Views
Last Modified: 2014-01-08
In running the Get-mailboxStatistics, I keep getting the following error:

Get-MailboxStatistics |Where {$_.alias -eq 'Jsmith'}

"The term 'Where' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again."

I also tried the ? alias, same error.  Any thoughts?
0
Comment
Question by:K Anthony O365
  • 4
  • 3
8 Comments
 
LVL 19

Expert Comment

by:Patricksr1972
ID: 39766349
Hi

Shouldnt Where be substituted by Where-Object and add the server like below?

Get-MailboxStatistics -server serverhere |Where-Object {$_.alias -eq 'Jsmith'}

Please try it, havent got PS near now.
0
 
LVL 19

Expert Comment

by:Patricksr1972
ID: 39766365
*
0
 

Author Comment

by:K Anthony O365
ID: 39766379
The server switch doesn't make a difference. Getting same error.

At one time I was able to use Get-MailboxStatistics -database MB1 |Where-Object {$_.alias -eq 'Jsmith'}

Not sure what happened.
0
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.

 

Accepted Solution

by:
K Anthony O365 earned 0 total points
ID: 39766388
Correction: I just closed my Powershell Session and tried again, and it worked!!
0
 
LVL 19

Expert Comment

by:Patricksr1972
ID: 39766417
It looks like a valid command....

Super !!!
0
 

Author Comment

by:K Anthony O365
ID: 39766448
I've requested that this question be closed as follows:

Accepted answer: 0 points for ktookes's comment #a39766388

for the following reason:

I was able to solve this by closing and reopening the PS Session. Worked!
0
 
LVL 19

Expert Comment

by:Patricksr1972
ID: 39766449
Sorry for objecting but i corrected the command from the question which worked.
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

Suggested Solutions

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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…
how to add IIS SMTP to handle application/Scanner relays into office 365.

776 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