Hi,

I’m running hybrid exchange online. I want to run the get-mailbox | get mailboxstastics command only for certain users.

I can do it for a single user or for all users.

Is there a way to filter on

  • Office 365 license type
  • AD Group
  • AD Distribution Group

Many Thanks

7 Spice ups
$users = Get-ADGroupMember "groupname" | select -ExpandProperty name
foreach ($user in $users) {
    Get-Mailbox $user
} 

or

$users = Get-DistributionGroupMember "groupname" | select -ExpandProperty name
foreach ($user in $users) {
    Get-Mailbox $user
} 

Not sure about O365 licensing type though because we don’t use O365.

2 Spice ups

This will be helpful

# E5 : tenant:ENTERPRISEPREMIUM_NOPSTNCONF
# E3 : tenant:ENTERPRISEPACK
#E1 : tenant:STANDARDPACK
# 365 Business = tenant:SMB_BUSINESS
# Exchange Online Plan 1 : tenant:EXCHANGESTANDARD
# Exchange Online Plan 2 : tenant:EXCHANGEENTERPRISE

# Enumerate everyone who has an E1 License Assigned.

get-MSOLUser -All | where {$_.isLicensed -eq "TRUE" -and $_.Licenses.AccountSKUID -eq "tenant:STANDARDPACK"}
## group member
$users = Get-ADGroupMember "groupname" | select -Exp samaccountname
foreach ($user in $users) {
    Get-Mailbox $user |select displayname,name
} 

## DL
Get-DistributionGroupMember "groupname" | select  name

2 Spice ups

Kinda of a rant. Refreshing user mailbox status is much more of a pain than needed. I have common e-mails I deal with based on job description. So I have to work a lot with disconnected mailboxes, and not groups. I should be able to call this up by mailbox names and not have to drill down and find Identities. I just end up run mailbox stats updates on the entire database.

1 Spice up

hello tabaiethomson2

have you tried that?

get-MSOLUser -All | where {$_.isLicensed -eq "TRUE" -and $_.Licenses.AccountSKUID -eq "tenant:STANDARDPACK"} 

Hi @JitenSh,

Using the group name gave me what I needed this time. Thanks for your responses - Im sure they will become useful in the future.

1 Spice up