Teams recording removal (Manual)

Updated 16 Nov 20262 min read

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#

  1. Open PowerShell as an administrator.

  2. Run the below command to allow remote scripts to run (this only changes your current PowerShell session)

powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
  1. Import the required modules

powershell
Import-Module MicrosoftTeams -Force
Import-Module Microsoft.Graph.Authentication -Force
Import-Module Microsoft.Graph.Groups -Force
Import-Module Microsoft.Graph.Identity.DirectoryManagement -Force
  1. Connect to Microsoft Teams

powershell
Connect-MicrosoftTeams
  1. Connect to Microsoft Graph

powershell
Connect-MgGraph -Scopes "Group.ReadWrite.All","Organization.Read.All" -NoWelcome

Step 1: Remove group policy assignments#

Before removing the policy itself, you must first remove any group assignments linked to it.

  1. List current group policy assignments:

powershell
Get-CsGroupPolicyAssignment -PolicyType TeamsComplianceRecordingPolicy
  1. For each assignment listed, remove it using the GroupId from the output above:

powershell
Remove-CsGroupPolicyAssignment -GroupId ggggggg-gggg-gggg-gggg-gggggggggggg -PolicyType TeamsComplianceRecordingPolicy

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).

  1. List the current compliance recording applications to find the full Identity:

powershell
Get-CsTeamsComplianceRecordingApplication
  1. The Identity will be in the format Tag:PolicyName/Bot1ObjectId. Remove the application link using this identity:

powershell
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.

  1. List the current policies to confirm the name:

powershell
Get-CsTeamsComplianceRecordingPolicy
  1. Remove the policy (replace with your policy identity):

powershell
Remove-CsTeamsComplianceRecordingPolicy -Identity "Tag:MegaCorpComplianceRecordingPolicy"

Step 4: Remove the bot application instances#

Since Focus uses two bots, you need to remove both.

  1. List current application instances to confirm the bot details:

powershell
Get-CsOnlineApplicationInstance
  1. Remove Bot 1 using its ObjectId:

powershell
Remove-CsOnlineApplicationInstance -Identity BOT-1-OBJECT-ID
  1. Remove Bot 2 using its ObjectId:

powershell
Remove-CsOnlineApplicationInstance -Identity BOT-2-OBJECT-ID

Step 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:

  1. Find the group ID, update the group name accordingly:

powershell
Get-MgGroup -Filter "displayName eq 'Recorded Users Group Name'"
  1. Remove the group using the Id from the output:

powershell
Remove-MgGroup -GroupId ggggggg-gggg-gggg-gggg-gggggggggggg

Via the Azure Portal:

  1. Go to https://admin.cloud.microsoft/ → Teams & Groups → Active teams & groups → Security groups

  2. Find and select the group

  3. Delete the group


Verify removal#

Run the following commands to confirm everything has been cleaned up:

powershell
# 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

Was this page helpful?