Today, I was approached by a peer with a particularly interesting situation–blocking a particular type of system-generated message from hitting the mailbox. In particular, a voicemail.
Background
Voicemail messages in Exchange Online / Teams Phone world are delivered via email to the recipient’s mailbox and generally include the voicemail as an audio attachment in addition to a transcription of the message. Should you need to block it, here’s a quick howto, both from PowerShell and the Exchange Admin center.
Blocking the message via a transport rule in the Exchange admin center
First, we’ll block it from the Exchange Admin center.
- Navigate to the Exchange Admin Center (https://admin.microsoft.com | Admin centers | Exchange or https://outlook.office365.com/ecp).
- Select Mail flow.

- Click the + and select Create a new rule…

- Enter a Name, and then select the link for More options…
- Then, expand Apply this rule if…, point to The message properties… and then select include the message type

- From the Select message type drop-down, select Voice mail and then click OK.

- Under Do the following…, point to Block the message and then select Delete the message without notifying anyone.

- Click Save.
After a brief period of replication, the rule will be active!
Blocking the message via a transport rule through PowerShell
You can also create the rule via PowerShell using the following procedure:
- Connect to Exchange Online PowerShell using the following script:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.protection.outlook.com/powershell-liveid/ -Authentication Basic -AllowRedirection Import-PSSession $Session
- Create a new transport rule with the following command:
New-TransportRule -Name "Drop Voicemail" -Description "Drop Voicemail" -MessageTypeMatches Voicemail -DeleteMessage $True
After a brief period of replication, the rule should be enabled.
Notes
This process prevents voicemails org-wide from being delivered. You can scope it using the “Sent to” parameters of the rule in the event that you only need to block it for a subset of your users. In either case, they’ll still be generated initially, but the voicemail will not accessible in the Teams app. Since the voice mail email message is linked to the Teams Phone app, blocking the voicemail delivery will in effect, disable voicemail for the user. The only storage for the voicemail is in the user’s mailbox (you can confirm this by deleting the email containing a voicemail audio file and then attempting to retrieve it in Teams).

