Commands › Microsoft Teams

Remove-CsGroupPolicyAssignment

Microsoft Teams MicrosoftTeams Remove-*

This cmdlet is used to remove a group policy assignment.

Quick start script

# Remove-CsGroupPolicyAssignment — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-MicrosoftTeams -CertificateThumbprint $thumb -ApplicationId $appId -TenantId $tenantId

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-CsGroupPolicyAssignment
$before | Format-List

# 3. Make the change (dry run first)
Remove-CsGroupPolicyAssignment -GroupId <String> -PolicyType <String> -WhatIf
Remove-CsGroupPolicyAssignment -GroupId <String> -PolicyType <String>

# 4. Verify and diff
$after = Get-CsGroupPolicyAssignment
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

Remove-CsGroupPolicyAssignment -GroupId <String> -PolicyType <String> [-Break]
 [-HttpPipelineAppend <SendAsyncStep[]>] [-HttpPipelinePrepend <SendAsyncStep[]>] [-PassThru] [-Proxy <Uri>]
 [-ProxyCredential <PSCredential>] [-ProxyUseDefaultCredentials] [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters (11)

ParameterTypeRequiredWhat it controls
-Break SwitchParameter Wait for .NET debugger to attach
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-GroupId String yes The ID of the group from which the assignment will be removed.
-HttpPipelineAppend SendAsyncStep[] SendAsync Pipeline Steps to be appended to the front of the pipeline
-HttpPipelinePrepend SendAsyncStep[] SendAsync Pipeline Steps to be prepended to the front of the pipeline
-PassThru SwitchParameter Returns true when the command succeeds
-PolicyType String yes The policy type of the assignment to be removed from the group.
-Proxy Uri The URI for the proxy server to use
-ProxyCredential PSCredential Credentials for a proxy server to use for the remote call
-ProxyUseDefaultCredentials SwitchParameter Use the default credentials for the proxy
-WhatIf SwitchParameter Shows what would happen if the cmdlet runs. The cmdlet is not run.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.