Dynamic distribution groups are something else you might want to consider, but those aren’t a subject for the current article. An updated version of the above cmdlet that accounts for Groups will look like this: Get-Recipient -Filter "Members -eq 'CN=user,OU=,OU=Microsoft Exchange Hosted Organizations,DC=EURPR03A001,DC=prod,DC=outlook,DC=com'" -RecipientTypeDetails GroupMailbox,MailUniversalDistributionGroup,MailUniversalSecurityGroupĪnd will return all Distribution groups, Mail-enabled security groups and Office 365 groups the user is member of. Namely, the Get-Recipient cmdlet in EO doesn’t return Office 365 Groups objects (the new, “modern” groups) unless you specifically include them. Now, there’s also one caveat you might want to consider when using the above cmdlet. Where ‘CN=user,OU=,OU=Microsoft Exchange Hosted Organizations, DC=EURPR03A001, DC=prod, DC=outlook, DC=com’ is the DistinguishedName of the user, obtainable for example via: Get-User | select -ExpandProperty DistinguishedName
Getting group membershipĪs a reminder, here’s how to quickly get a list of all groups a user is member of via the EO Remote PowerShell cmdlets: Get-Recipient -Filter "Members -eq 'CN=user,OU=,OU=Microsoft Exchange Hosted Organizations,DC=EURPR03A001,DC=prod,DC=outlook,DC=com'" To get the documentation on installing and using the module, click here. To get the latest version of the AzureAD PowerShell module, click here. Continuing the “how to do this with the new Azure AD PowerShell module” series, in this article we will explore some useful cmdlets that quickly list all Groups a user is member of, or is configured as Owner/Manager.