Remove-CsGroupPolicyAssignment

This cmdlet is used to remove a group policy assignment.

Syntax

Remove-CsGroupPolicyAssignment
      -GroupId <String>
      -PolicyType <String>

Description

This cmdlet removes the policy of a specific type from a group. A group can only be assigned one policy of a given type, so the name of the policy to be removed does not need to be specified.

When a policy assignment is removed from a group, any other group policy assignments of the same type that have lower rank will be updated. For example, if the policy assignment with rank 2 is removed, then the rank 3 and 4 policy assignments will be updated to rank 2 and 3 respectively.

Examples

EXAMPLE 1

Get-CsGroupPolicyAssignment -PolicyType TeamsMeetingPolicy

GroupId                              PolicyType         PolicyName Rank CreatedTime           CreatedBy
-------                              ----------         ---------- ---- -----------           ---------
d8ebfa45-0f28-4d2d-9bcc-b158a49e2d17 TeamsMeetingPolicy AllOn      1    10/29/2019 3:57:27 AM aeb7c0e7-2f6d-43ef-bf33-bfbcb93fdc64
e050ce51-54bc-45b7-b3e6-c00343d31274 TeamsMeetingPolicy AllOff     2    11/2/2019 12:20:41 AM aeb7c0e7-2f6d-43ef-bf33-bfbcb93fdc64
566b8d39-5c5c-4aaa-bc07-4f36278a1b38 TeamsMeetingPolicy Kiosk      3    11/2/2019 12:14:41 AM aeb7c0e7-2f6d-43ef-bf33-bfbcb93fdc64

Remove-CsGroupPolicyAssignment -GroupId e050ce51-54bc-45b7-b3e6-c00343d31274 -PolicyType TeamsMeetingPolicy 

Get-CsGroupPolicyAssignment -PolicyType TeamsMeetingPolicy

GroupId                              PolicyType         PolicyName Rank CreatedTime           CreatedBy
-------                              ----------         ---------- ---- -----------           ---------
d8ebfa45-0f28-4d2d-9bcc-b158a49e2d17 TeamsMeetingPolicy AllOn      1    10/29/2019 3:57:27 AM aeb7c0e7-2f6d-43ef-bf33-bfbcb93fdc64
566b8d39-5c5c-4aaa-bc07-4f36278a1b38 TeamsMeetingPolicy Kiosk      2    11/2/2019 12:14:41 AM aeb7c0e7-2f6d-43ef-bf33-bfbcb93fdc64

In this example, the policy assignment with rank 2 is removed. As a result, the policy assignment with rank 3 is updated to rank 2.

Parameters

-GroupId

The ID of the group from which the assignment will be removed.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PolicyType

The policy type of the assignment to be removed from the group.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False