Remove-MSTGroupPolicyAssignment
Teams: Remove a group policy assignment
#Requires -Version 5.1
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true)]
[string]$GroupId,
[Parameter(Mandatory = $true)]
[ValidateSet('TeamsAppSetupPolicy','TeamsCallingPolicy','TeamsCallParkPolicy','TeamsChannelsPolicy','TeamsComplianceRecordingPolicy','TeamsEducationAssignmentsAppPolicy','TeamsMeetingBroadcastPolicy','TeamsMeetingPolicy','TeamsMessagingPolicy')]
[string]$PolicyType
)
Process {
try {
[hashtable]$remArgs = @{'ErrorAction' = 'Stop'; 'GroupId' = $GroupId; 'PolicyType' = $PolicyType}
$null = Remove-CsGroupPolicyAssignment @remArgs
[PSCustomObject]@{
Timestamp = Get-Date -Format 'yyyy-MM-dd HH:mm:ss'
GroupId = $GroupId
PolicyType = $PolicyType
Status = 'Group policy assignment successfully removed'
}
}
catch { throw }
}Object ID of the group
The type of the policy to remove