Commands › Microsoft Teams

New-CsTeamsShiftsPolicy

Microsoft Teams MicrosoftTeams New-*

This cmdlet allows you to create a new TeamsShiftPolicy instance and set it's properties.

Quick start script

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

# 3. Make the change (dry run first)
New-CsTeamsShiftsPolicy -Identity <XdsIdentity> -WhatIf
New-CsTeamsShiftsPolicy -Identity <XdsIdentity>

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

Syntax

New-CsTeamsShiftsPolicy [-ShiftNoticeFrequency <String>] [-ShiftNoticeMessageType <String>]
 [-ShiftNoticeMessageCustom <String>] [-AccessType <String>] [-AccessGracePeriodMinutes <Int64>]
 [-EnableScheduleOwnerPermissions <Boolean>] [-Identity] <String> [-Force] [-WhatIf] [-Confirm]
 [<CommonParameters>]

Parameters (10)

ParameterTypeRequiredWhat it controls
-AccessGracePeriodMinutes Int64 Indicates the grace period time in minutes between when the first shift starts or last shift ends and when access is blocked.
-AccessType String Indicates the Teams access type granted to the user. Today, only unrestricted access to Teams app is supported. Use 'UnrestrictedAccess_TeamsApp' as the value for this setting, or is set by default. For Teams Off...
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-EnableScheduleOwnerPermissions Boolean Indicates whether a user can manage a Shifts schedule as a team member.
-Force SwitchParameter Suppresses the display of any non-fatal error message that might arise when running the command.
-Identity XdsIdentity yes Policy instance name.
-ShiftNoticeFrequency String Frequency of warning dialog displayed when user opens Teams. Select one of Always, ShowOnceOnChange, Never.
-ShiftNoticeMessageCustom String Provide a custom message. Must set ShiftNoticeMessageType to 'CustomMessage' to enforce this.
-ShiftNoticeMessageType String The warning message is shown in the blocking dialog when a user access Teams off shift hours. Select one of 7 Microsoft provided messages, a default message or a custom message. 'Message1' - Your employer does not...
-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.