Whitelisting the Microsoft Teams Bot App
In order to complete the steps below, you must have Global Administrator role.
The same Bot can be whitelisted in multiple Microsoft Entra (formerly Azure AD) tenants, and can be used for multiple compliance policies.
The registration consists of the following steps:
Prerequisites
Download and install PowerShell 5.1.
Open PowerShell as an administrator.
Set the security protocol to TLS 1.2 with the following command:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12Install the NuGet package provider module by running the following command:
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -ForceInstall the Microsoft Teams module by running the following command:
Install-Module MicrosoftTeams
Accessing the tenant using PowerShell
Separate Azure tenants for the recording provider (bot) and for the Teams environment to record
In the case when the recorded Teams environment and the recording bot are in separate Microsoft Entra tenants, the following steps have to be done in the Teams tenant.
Open PowerShell as an administrator.
Update the Teams module by running the following command:
Update-Module MicrosoftTeamsConnect to the Teams tenant by running the following command:
Connect-MicrosoftTeamsProvide the user credentials in the login prompt that appears.
Registering the bot as a Teams application
Following the login in Step 4 of Accessing the tenant using PowerShell, execute the following command. Provide a unique UPN for the recording bot as the <UPN> value, for example, verbabot@contoso.com. Provide a name as the <displayName> value. Replace the <botAppId> value with the application ID from the previous section (See Creating a Microsoft Teams Compliance Policy ).
New-CsOnlineApplicationInstance -UserPrincipalname <UPN> -DisplayName '<displayName>' -ApplicationId <botAppId>
In the command results, note down the ObjectId, as it is needed for further configuration.
Execute the following command. Replace the <ObjectId> value with the ObjectID specified by the result of the previous command.
For Microsoft Teams PowerShell versions older than 6.0.0, execute the following command:
Sync-CsOnlineApplicationInstance -ObjectId <ObjectId>For Microsoft Teams PowerShell versions 6.0.0 and newer, execute the following command:
Sync-CsOnlineApplicationInstance -ObjectId <ObjectId> -ApplicationId <botAppId>
(Optional) If 2N recording is being configured, then repeat steps 1-3 for the second bot registration, using the new ObjectId in the commands.