Solved

Exchange 2010 powershell query

Posted on 2014-09-25
4
279 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
  • 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 500 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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
Synchronize a new Active Directory domain with an existing Office 365 tenant
To show how to create a transport rule 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 >> Rules tab.:  To cr…
To show how to generate a certificate request 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 Servers >> Certificates…

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now