Commands › Microsoft Teams

Grant-CsTeamsShiftsPolicy

Microsoft Teams MicrosoftTeams Grant-*

This cmdlet supports applying the TeamsShiftsPolicy to users in a tenant.

Quick start script

# Grant-CsTeamsShiftsPolicy — 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-CsTeamsShiftsPolicy -Global <SwitchParameter> -Group <String> -PolicyName <String> | Format-List

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

Syntax — 4 parameter sets

Identity (Default)

Grant-CsTeamsShiftsPolicy [<CommonParameters>]

GrantToUser

Grant-CsTeamsShiftsPolicy [-Identity] <String> [[-PolicyName] <String>] [<CommonParameters>]

GrantToGroup

Grant-CsTeamsShiftsPolicy [[-PolicyName] <String>] [-Group] <String> [-Rank] <Int32> [<CommonParameters>]

GrantToTenant

Grant-CsTeamsShiftsPolicy [[-PolicyName] <String>] [-Global] [-Force] [<CommonParameters>]

Parameters (6)

ParameterTypeRequiredWhat it controls
-Force SwitchParameter Suppresses the display of any non-fatal error message that might arise when running the command.
-Global SwitchParameter yes When you use this cmdlet without specifying a user identity, the policy applies to all users in your tenant. To skip a warning when you do this operation, specify "-Global".
-Group String yes Specifies the group used for the group policy assignment.
-Identity UserIdParameter UserId to whom the policy is granted. Email id is acceptable.
-PolicyName String yes The name of the TeamsShiftsPolicy instance that is being applied to the user.
-Rank Int32 yes The rank of the policy assignment, relative to other group policy assignments for the same policy type.

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