Skip to main content

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.

danger

Removing the recording configuration will stop all compliance recording for affected users. Make sure this is intentional before proceeding.

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)

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process
  1. Import 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 -Force
  1. Connect to Microsoft Teams
Connect-MicrosoftTeams
  1. Connect to Microsoft Graph
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:
Get-CsGroupPolicyAssignment -PolicyType TeamsComplianceRecordingPolicy
  1. For each assignment listed, remove it using the GroupId from the output above:
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:
Get-CsTeamsComplianceRecordingApplication
  1. The 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"
info

Replace the Identity value with the one shown in your Get-CsTeamsComplianceRecordingApplication output. Removing the Bot 1 entry will also remove the Bot 2 pairing.


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:
Get-CsTeamsComplianceRecordingPolicy
  1. Remove 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.

  1. List current application instances to confirm the bot details:
Get-CsOnlineApplicationInstance
  1. Remove Bot 1 using its ObjectId:
Remove-CsOnlineApplicationInstance -Identity BOT-1-OBJECT-ID
  1. Remove Bot 2 using its ObjectId:
Remove-CsOnlineApplicationInstance -Identity BOT-2-OBJECT-ID
info

If you get a permissions error, you may need to remove the bots manually from the Azure Portal:

  1. Go to https://portal.azure.com β†’ Entra ID β†’ Users
  2. Search for each bot UPN (e.g. focusrecordingbot_1@megacorp.onmicrosoft.com and focusrecordingbot_2@megacorp.onmicrosoft.com)
  3. Delete both users

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:
Get-MgGroup -Filter "displayName eq 'Focus Recorded Users'"
  1. Remove the group using the Id from the output:
Remove-MgGroup -GroupId ggggggg-gggg-gggg-gggg-gggggggggggg
warning

Removing the group will also remove all group membership. If you recreate the group later, users will need to be re-added.

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:

# 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