Hi,<\/p>\n
I’m running hybrid exchange online. I want to run the get-mailbox | get mailboxstastics command only for certain users.<\/p>\n
I can do it for a single user or for all users.<\/p>\n
Is there a way to filter on<\/p>\n
Many Thanks<\/p>","upvoteCount":7,"answerCount":6,"datePublished":"2018-05-24T09:19:19.000Z","author":{"@type":"Person","name":"tabiethomson2","url":"https://community.spiceworks.com/u/tabiethomson2"},"acceptedAnswer":{"@type":"Answer","text":"
$users = Get-ADGroupMember \"groupname\" | select -ExpandProperty name\nforeach ($user in $users) {\n Get-Mailbox $user\n} \n<\/code><\/pre>\nor<\/p>\n
$users = Get-DistributionGroupMember \"groupname\" | select -ExpandProperty name\nforeach ($user in $users) {\n Get-Mailbox $user\n} \n<\/code><\/pre>\nNot sure about O365 licensing type though because we don’t use O365.<\/p>","upvoteCount":2,"datePublished":"2018-05-24T09:31:42.000Z","url":"https://community.spiceworks.com/t/get-mailbox-only-for-certain-users/653383/2","author":{"@type":"Person","name":"big-green-man","url":"https://community.spiceworks.com/u/big-green-man"}},"suggestedAnswer":[{"@type":"Answer","text":"
Hi,<\/p>\n
I’m running hybrid exchange online. I want to run the get-mailbox | get mailboxstastics command only for certain users.<\/p>\n
I can do it for a single user or for all users.<\/p>\n
Is there a way to filter on<\/p>\n
\n- Office 365 license type<\/li>\n
- AD Group<\/li>\n
- AD Distribution Group<\/li>\n<\/ul>\n
Many Thanks<\/p>","upvoteCount":7,"datePublished":"2018-05-24T09:19:19.000Z","url":"https://community.spiceworks.com/t/get-mailbox-only-for-certain-users/653383/1","author":{"@type":"Person","name":"tabiethomson2","url":"https://community.spiceworks.com/u/tabiethomson2"}},{"@type":"Answer","text":"
This will be helpful<\/p>\n
# E5 : tenant:ENTERPRISEPREMIUM_NOPSTNCONF\n# E3 : tenant:ENTERPRISEPACK\n#E1 : tenant:STANDARDPACK\n# 365 Business = tenant:SMB_BUSINESS\n# Exchange Online Plan 1 : tenant:EXCHANGESTANDARD\n# Exchange Online Plan 2 : tenant:EXCHANGEENTERPRISE\n\n# Enumerate everyone who has an E1 License Assigned.\n\nget-MSOLUser -All | where {$_.isLicensed -eq \"TRUE\" -and $_.Licenses.AccountSKUID -eq \"tenant:STANDARDPACK\"}\n## group member\n$users = Get-ADGroupMember \"groupname\" | select -Exp samaccountname\nforeach ($user in $users) {\n Get-Mailbox $user |select displayname,name\n} \n\n## DL\nGet-DistributionGroupMember \"groupname\" | select name\n\n<\/code><\/pre>","upvoteCount":2,"datePublished":"2018-05-24T09:53:32.000Z","url":"https://community.spiceworks.com/t/get-mailbox-only-for-certain-users/653383/3","author":{"@type":"Person","name":"jitensh","url":"https://community.spiceworks.com/u/jitensh"}},{"@type":"Answer","text":"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.<\/p>","upvoteCount":1,"datePublished":"2018-05-24T11:09:40.000Z","url":"https://community.spiceworks.com/t/get-mailbox-only-for-certain-users/653383/4","author":{"@type":"Person","name":"theborgman77","url":"https://community.spiceworks.com/u/theborgman77"}},{"@type":"Answer","text":"
hello tabaiethomson2<\/p>\n
have you tried that?<\/p>\n
get-MSOLUser -All | where {$_.isLicensed -eq \"TRUE\" -and $_.Licenses.AccountSKUID -eq \"tenant:STANDARDPACK\"} \n<\/code><\/pre>","upvoteCount":0,"datePublished":"2018-05-24T12:13:09.000Z","url":"https://community.spiceworks.com/t/get-mailbox-only-for-certain-users/653383/5","author":{"@type":"Person","name":"jitensh","url":"https://community.spiceworks.com/u/jitensh"}},{"@type":"Answer","text":"