Solved

Exchange 2010 powershell query

Posted on 2014-09-25
4
285 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In-place Upgrading Dirsync to Azure AD Connect
In this video we show how to create a Distribution Group 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 Recipients >>…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

821 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