Teams administrators can configure various options for communication with external users.
Administrators can now also block specific external users. Microsoft mentioned the possibility last August.
The availability of the delete API (removeallaccessforuser API) does not stop a malicious user from resending a Microsoft Teams message to the same victim. To help prevent that, a block user feature will allow the admin to block the malicious user from reaching out again. To make this possible, we will use a similar feature as the allow/block list in federation identity credentials to block the malicious user from the entire organization.
The new configuration is available in the Teams Admin Center > Users > External Access > Organization Settings and disabled by default.

Alternatively, the configuration is also possible with the Teams PowerShell module.
The configuration is in the rollout. If it is not yet available for your tenant, PowerShell will inform you that your tenant has not been enabled for the Private Preview.

There are two new properties for the External Access configuration in PowerShell: BlockExternalAccessUserAccess and BlockedUsers
Both properties must be configured.
BlockExternalAccessUserAccess
Designates whether BlockedUsers list is taking effect or not. $true means BlockedUsers are blocked and can’t communicate with internal users.
BlockedUsers
You can specify blocked users using a List object that contains either the user email or the MRI from the external user you want to block. The user in the list will not be able to communicate with the internal users in your organization.

The configuration is enabled using the command Set-CsTeamsExternalAccessConfiguration.
Set-CsTeamsExternalAccessConfiguration -Identity Global -BlockExternalUserAccess $true -BlockedUsers "<user1>@<domain.com>","<user2>@<domain.com>"
The change takes a few hours.
- Teams informs blocked users in existing chats that messages can no longer be sent.

- In new chats, Teams notifies blocked users that the communication is not possible.
