Teams recording removal (Manual)
Removal process#
This guide covers how to manually remove the Teams compliance recording configuration from your tenant using PowerShell. These are the reverse of the steps in the manual setup guide.
Requirements#
An Azure global admin user account or Teams global admin user account
The same PowerShell modules used during setup
PowerShell setup#
Open PowerShell as an administrator.
Run the below command to allow remote scripts to run (this only changes your current PowerShell session)
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope ProcessImport the required modules
Import-Module MicrosoftTeams -Force
Import-Module Microsoft.Graph.Authentication -Force
Import-Module Microsoft.Graph.Groups -Force
Import-Module Microsoft.Graph.Identity.DirectoryManagement -ForceConnect to Microsoft Teams
Connect-MicrosoftTeamsConnect to Microsoft Graph
Connect-MgGraph -Scopes "Group.ReadWrite.All","Organization.Read.All" -NoWelcomeStep 1: Remove group policy assignments#
Before removing the policy itself, you must first remove any group assignments linked to it.
List current group policy assignments:
Get-CsGroupPolicyAssignment -PolicyType TeamsComplianceRecordingPolicyFor each assignment listed, remove it using the GroupId from the output above:
Remove-CsGroupPolicyAssignment -GroupId ggggggg-gggg-gggg-gggg-gggggggggggg -PolicyType TeamsComplianceRecordingPolicyStep 2: Unlink the bots from the policy#
Before removing the policy, you need to unlink the recording applications (bots) from it. Since Focus uses a dual-bot setup, you need to remove the compliance recording application entry for Bot 1 (which also removes the Bot 2 pairing).
List the current compliance recording applications to find the full Identity:
Get-CsTeamsComplianceRecordingApplicationThe Identity will be in the format
Tag:PolicyName/Bot1ObjectId. Remove the application link using this identity:
Remove-CsTeamsComplianceRecordingApplication -Identity "Tag:MegaCorpComplianceRecordingPolicy/BOT-1-OBJECT-ID"Step 3: Remove the compliance recording policy#
Once the bot has been unlinked, you can remove the policy itself.
List the current policies to confirm the name:
Get-CsTeamsComplianceRecordingPolicyRemove the policy (replace with your policy identity):
Remove-CsTeamsComplianceRecordingPolicy -Identity "Tag:MegaCorpComplianceRecordingPolicy"Step 4: Remove the bot application instances#
Since Focus uses two bots, you need to remove both.
List current application instances to confirm the bot details:
Get-CsOnlineApplicationInstanceRemove Bot 1 using its ObjectId:
Remove-CsOnlineApplicationInstance -Identity BOT-1-OBJECT-IDRemove Bot 2 using its ObjectId:
Remove-CsOnlineApplicationInstance -Identity BOT-2-OBJECT-IDStep 5: Remove the security group (optional)#
If you also want to remove the security group that was used for recorded users, you can do so via PowerShell or the Azure Portal.
Via PowerShell:
Find the group ID, update the group name accordingly:
Get-MgGroup -Filter "displayName eq 'Recorded Users Group Name'"Remove the group using the Id from the output:
Remove-MgGroup -GroupId ggggggg-gggg-gggg-gggg-ggggggggggggVia the Azure Portal:
Go to https://admin.cloud.microsoft/ → Teams & Groups → Active teams & groups → Security groups
Find and select the group
Delete the group
Verify removal#
Run the following commands to confirm everything has been cleaned up:
# Should return no custom policies (only Global)
Get-CsTeamsComplianceRecordingPolicy
# Should return no results
Get-CsTeamsComplianceRecordingApplication
# Should return no application instances (both bots removed)
Get-CsOnlineApplicationInstance
# Should return no assignments
Get-CsGroupPolicyAssignment -PolicyType TeamsComplianceRecordingPolicy