Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 376
  • Last Modified:

Exchange 2007- Powershell Query

I would like to create a query showing users Title and name. The following works:

Get-User -Filter { Department -like '*IT' }

But it doesn't show the title of the user.

So i created this query but it doesn't work:

"Get-User -Filter { Department -like '*IT' } Format-List Name, Title"

[PS] C:\Windows\System32>Get-User -Filter { Department -like '*IT' } Format-List
 Name, Title
Get-User : A parameter cannot be found that matches parameter name 'Format-List
'.
At line:1 char:9
+ Get-User  <<<< -Filter { Department -like '*IT' } Format-List Name, Title

Any ideas? Thanks in advanced
0
ITNERD2009
Asked:
ITNERD2009
1 Solution
 
tigermattCommented:

You're missing a pipe character.

If you change your command to

Get-User -Filter { Department -like '*IT' } | Format-List Name, Title

...it should do exactly as you are expecting it to.

-Matt
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now