Remove a Compliance Policy from a Recorded User Group

Step 1: Find the Group Object ID.

✅ To apply the policy to a group, first we need to collect the Groups Object Id from Azure Entra.

  1. Login to the Azure Portal
  2. Search for Microsoft Entra Id
  3. From the left navigation, click Manage, Groups.
  4. From the left navigation, click All Groups.
  5. Search for the Recorded User group created in section 1.Create Azure Entra Security Groups for Luware Recording
  6. Click the Recorded User group name.
  7. Copy the Object Id.

Step 2: Install the Teams module and connect using PowerShell.

✅ Follow these steps within PowerShell ISE on your local machine.

  1. Open PowerShell ISE on your local machine (with Administrator permissions as you import new modules).
  2. Run the commands below from within your script pane:
    1. Running Install-Module MicrosoftTeams will download the Microsoft Teams PowerShell module. 
    2. After installation, running Connect-MicrosoftTeams will authenticate against the Azure Entra environment.
  3. Sign in with the Azure Entra account which has the Global Administrator or User Administrator role assigned. 

Step 3 - Remove the Compliance Recording Policy from an Azure Entra Group.

  1. Copy the command into PowerShell ISE on your local machine, or use the editor in Microsoft Teams Cloud Shell.
  2. Replace the <AzureGroupObjectId> with the Group Object Id copied in the previous section. 

Script:

Remove-CsGroupPolicyAssignment -GroupId "<AzureGroupObjectId>" -PolicyType TeamsComplianceRecordingPolicy

Example:

Remove-CsGroupPolicyAssignment -GroupId 085fd5ee-756a-4284-b81d-a62549f12293 -PolicyType TeamsComplianceRecordingPolicy

Step 4: Check that the policy has been removed.

✅ After a remove command has been enterer you can verify this by using the below scripts. This will show the policy is no longer applied even if Microsoft has not completed the action on the M365 backend. 

Script:

Get-CsGroupPolicyAssignment -GroupId <AzureGroupObjectId>

Example:

Get-CsGroupPolicyAssignment -GroupId 085fd5ee-756a-4284-b81d-a62549f12

Table of Contents