Update Address List Exchange Online PowerShell

Update Address List Exchange Online PowerShell

Hello,

AddressList in Exchange Online are quite particular. Indeed, when you create them, they are empty, you need to modify a Mailbox to let her “check” if it belong to some address list created after the mailbox creation.Let’s try. I have two room mailboxes with the attribute “Company” set to corp.

Update Address List Exchange Online PowerShell - Get-Recipient Room Mailboxes for Corp

Update Address List Exchange Online PowerShell – Get-Recipient Room Mailboxes for Corp

Get-Recipient -Filter {RecipientTypeDetails -eq 'RoomMailbox' -and Company -eq 'Corp'}

I want to create an AddressList with those mailboxes.

New-AddressList -Name 'Corp Rooms' -RecipientFilter "((Alias -ne `$null) -and (((RecipientDisplayType -eq 'ConferenceRoomMailbox') -or (RecipientDisplayType -eq 'SyncedConferenceRoomMailbox'))) -and (Company  -eq 'Corp') )" -Container 'All Rooms'
Update Address List Exchange Online PowerShell - New-AddressList

Update Address List Exchange Online PowerShell – New-AddressList

I can check the content of the AddressList with:

Get-Recipient -RecipientPreviewFilter (Get-AddressList -Identity 'Corp Rooms').RecipientFilter
Update Address List Exchange Online PowerShell - RecipientPreviewFilter

Update Address List Exchange Online PowerShell – RecipientPreviewFilter

We can see our 2 room mailboxes. Now let’s check from a user point of view:

Update Address List Exchange Online PowerShell - Empty AddressList

Update Address List Exchange Online PowerShell – Empty AddressList

It’s empty ! As a matter of fact, this is a documented “feature”:

https://support.microsoft.com/en-us/help/2955640/new-address-lists-that-you-create-in-exchange-online-don-t-contain-all

So, let’s try to tickle them…

Get-Recipient -Filter {RecipientTypeDetails -eq 'RoomMailbox' -and Company -eq 'Corp'} | Set-Mailbox -Simp
leDisplayName $null

And, voilĂ :

Update Address List Exchange Online PowerShell - Populated AddressList

Update Address List Exchange Online PowerShell – Populated AddressList

As you can see, if you modify the mailboxes, they will appear in the AddressList they belongs to. This is not something we were used to do in Exchange Onpremise.

Note: You can edit any attribute on the mailboxes, in the example above I used “SimpleDisplayName” because it’s not a visible one, so I don”t need to empty it after populated it like the example on the KB article I linked earlier.

Side note: If you want to group your room mailboxes by location/company, you may want to use the room list feature, I wrote an article about this.

Leave a Reply