Commands › Microsoft Teams

Grant-CsUserPolicyPackage

Microsoft Teams MicrosoftTeams Grant-*

This cmdlet supports applying a policy package to users in a tenant. Note that there is a limit of 20 users you can apply the package to at a time. To apply a policy package to a larger number of users, consider using New-CsBatchPolicyPackageAssignmentOperation.

Quick start script

# Grant-CsUserPolicyPackage — 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-CsUserPolicyPackage -Identity <String[]> -PackageName <String> | Format-List

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

Syntax

Grant-CsUserPolicyPackage [-Identity] <String[]> [-PackageName] <String> [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters (4)

ParameterTypeRequiredWhat it controls
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-Identity String[] yes A list of one or more users in the tenant. Note that there is a limit of 20 users you can apply the package to at a time.
-PackageName String yes The name of a specific policy package to apply. All possible policy package names can be found by running Get-CsPolicyPackage.
-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.