I hadn’t noticed until today that rooms are included in Office365 dynamic groups even if you selected “Users with Exchange mailboxes”. This creates an interesting effect if you send an appointment to that group, you will automatically book all your meetings rooms as well. Not necessarily what you want.

group

The solution is fairly straight forward. Via Powershell you add a specific filter for MailboxType as follows. Warning: you can’t edit the members filter from the EAC anymore after that.

#
# Connect to Office365
#
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
#
# Add the filter
#
Set-DynamicDistributionGroup -Identity "yourgroup@example.org" -RecipientFilter {(RecipientTypeDetails -eq 'UserMailbox')}
#
# Test the filter works by enumerating the members
#
$FTE = Get-DynamicDistributionGroup "yourgroup@example.org"
Get-Recipient -RecipientPreviewFilter $FTE.RecipientFilter
Advertisements