Commands › Microsoft Teams

New-CsBatchPolicyPackageAssignmentOperation

Microsoft Teams MicrosoftTeams New-*

This cmdlet submits an operation that applies a policy package to a batch of users in a tenant. A batch may contain up to 5000 users.

Quick start script

# New-CsBatchPolicyPackageAssignmentOperation — 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-CsBatchPolicyPackageAssignmentOperation
$before | Format-List

# 3. Make the change
New-CsBatchPolicyPackageAssignmentOperation -Identity <String[]> -PackageName <String>

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

Syntax

New-CsBatchPolicyPackageAssignmentOperation -Identity <String[]> -PackageName <String> [<CommonParameters>]

Parameters (2)

ParameterTypeRequiredWhat it controls
-Identity String[] yes A list of one or more users in the tenant. A user identity can either be a user's object id or email address.
-PackageName String yes The name of a specific policy package to apply. All policy package names can be found by running Get-CsPolicyPackage. To remove the currently assigned package, use $null or an empty string "". This will not remove...

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