Get-Recipient finally returns Office 365 Groups by default

Another one in the series of minor, but very useful improvements in Exchange Online PowerShell – the Get-Recipient cmdlet now returns Office 365 Group mailbox objects by default. Since Get-Recipient is one of my favorite cmdlets and I often used in my scripts, or when just doing a quick check, I couldn’t be happier 🙂

Why is this important you might ask? Imagine for example the following scenario: you want to create a new mailbox for your Sales team and want to assign the address to it accordingly. When trying to configure said address however you see Office 365 complaining about the fact that the address is already assigned to a different object. So how do you find the object to which this address is assigned? The quickest way to do so is to use the Get-Recipient cmdlet:


The beauty of this approach is that the Get-Recipient cmdlet covers all object types recognized by Exchange, thus you don’t have to do lengthy loops over all mailboxes, all DGs, and so on. Whichever object has the address assigned, it should be returned when using Get-Recipient. Up until recently however, a small “gotcha” existed – no Group mailbox objects were returned in the output of Get-Recipient, unless you “instructed” Exchange to do so by specifying the –RecipientTypeDetails parameter:

Get-Recipient -RecipientTypeDetails GroupMailbox

In turn, if you wanted to include Office 365 Groups in the check for assigned addresses, you had to either craft a lengthy expression containing all valid recipient types, or run the cmdlet two times:

Get-Recipient -RecipientTypeDetails GroupMailbox

This is just one of many examples in which the Get-Recipient cmdlet was useful, with the handling of all these being unnecessary complicated by the fact that Group mailboxes were not included by default. Well, rejoice! With this small update, you can just use the first example and be done with it. Office 365 Group mailboxes are now treated just like any other recipient type now and all is fine with the world 🙂

This entry was posted in Exchange Online, Office 365, PowerShell. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *