Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Exchange 2010 powershell query

Posted on 2014-09-25
4
Medium Priority
?
290 Views
Last Modified: 2014-09-26
I would like to use the Get-CASmailbox command to find out which users have OWA enabled, however, I would like to limit the query to only users who are a member of a specific email distribution group.
0
Comment
Question by:AManoux
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 12

Expert Comment

by:Vaseem Mohammed
ID: 40343436
Check this one liner, Provide a GroupName
Get-DistributionGroup <GroupName>| Get-DistributionGroupMember | foreach{Get-CASMailbox $_.samaccountname | where OWAEnabled -EQ $True |select Name, SAMAccountName, OWAEnabled, PrimarySMTPAddress}

Open in new window

0
 
LVL 1

Author Comment

by:AManoux
ID: 40344329
with that command I get this error...

ForEach-Object : Cannot bind parameter 'FilterScript'. Cannot convert the "OWAEnabled" value of type "System.String" to type "System.Management.Automation.ScriptBlock".
At line:1 char:87
0
 
LVL 3

Accepted Solution

by:
ericwoodford earned 2000 total points
ID: 40346612
slight modification to Vaseem's script..

Get-DistributionGroupMember "group name"  | Get-CASMailbox | Where-object {$_.owaenabled}

Open in new window


Get-distributiongroupmember returns mail enabled objects. If they are all mailboxes, this shouldn't generate errors. Only issue being it doesn't recurse into subgroups. OWAEnabled is a true/false property, therefore our where-object will return 'true' results.
0
 
LVL 1

Author Closing Comment

by:AManoux
ID: 40346820
Thanks ericwoodford.  That did the trick!
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

New style of hardware planning for Microsoft Exchange server.
Want to know how to use Exchange Server Eseutil command? Go through this article as it gives you the know-how.
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
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…

705 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