[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Powershell Command 'Where' clause issue

Posted on 2014-01-08
8
Medium Priority
?
722 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:Anthony K O365
  • 4
  • 3
7 Comments
 
LVL 23

Expert Comment

by:Patrick Bogers
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 23

Expert Comment

by:Patrick Bogers
ID: 39766365
*
0
 

Author Comment

by:Anthony K 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
A Cyber Security RX to Protect Your Organization

Join us on December 13th for a webinar to learn how medical providers can defend against malware with a cyber security "Rx" that supports a healthy technology adoption plan for every healthcare organization.

 

Accepted Solution

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

Expert Comment

by:Patrick Bogers
ID: 39766417
It looks like a valid command....

Super !!!
0
 

Author Comment

by:Anthony K 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 23

Expert Comment

by:Patrick Bogers
ID: 39766449
Sorry for objecting but i corrected the command from the question which worked.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
Exchange administrators are always vigilant about Exchange crashes and disasters that are possible any time. It is quite essential to identify the symptoms of a possible Exchange issue and be prepared with a proper recovery plan. There are multiple…
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

834 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