Commands › Microsoft Teams

Grant-CsGroupPolicyPackageAssignment

Microsoft Teams MicrosoftTeams Grant-*

This cmdlet assigns a policy package to a group in a tenant.

Quick start script

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

# 2. Run and inspect
Grant-CsGroupPolicyPackageAssignment -GroupId <String> -PackageName <String> | Format-List

# 3. Export for evidence / drift tracking
Grant-CsGroupPolicyPackageAssignment | Export-Clixml .\CsGroupPolicyPackageAssignment-$(Get-Date -Format yyyyMMdd).xml

Syntax

Grant-CsGroupPolicyPackageAssignment -GroupId <String> -PackageName <String> [-PolicyRankings <String[]>] [<CommonParameters>] [-Confirm] [-WhatIf]

Parameters (5)

ParameterTypeRequiredWhat it controls
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-GroupId String yes A group id in the tenant. It can either be a group's object id or a group's email address.
-PackageName String yes The name of a policy package. All policy package names can be found by running Get-CsPolicyPackage. To reset the currently assigned package value for the group, use $null or an empty string "". This will not remove...
-PolicyRankings String[] The policy rankings for each of the policy types in the package. To specify the policy rankings, follow this format: "\<PolicyType\>, \<PolicyRank\>". Delimiters of ' ', '.', ':', '\t' are also acceptable. Supported...
-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.