Commands › Microsoft Teams

Remove-CsUserLicenseGracePeriod

Microsoft Teams MicrosoftTeams Remove-*

The `CsUserLicenseGracePeriod` cmdlet expedites the delicensing operation for the assigned plan(s) of a user/resource account by removing the grace period, permanently deleting the assigned plan(s). Note that this cmdlet is to be used only by tenants with license resiliency enabled. (License resiliency is currently under private preview and not available for everyone.)

Quick start script

# Remove-CsUserLicenseGracePeriod — 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-CsUserLicenseGracePeriod
$before | Format-List

# 3. Make the change (dry run first)
Remove-CsUserLicenseGracePeriod -Body <IUserDelicensingAccelerationPatch> -Identity <String> -InputObject <IConfigApiBasedCmdletsIdentity> -WhatIf
Remove-CsUserLicenseGracePeriod -Body <IUserDelicensingAccelerationPatch> -Identity <String> -InputObject <IConfigApiBasedCmdletsIdentity>

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

Syntax

Remove-CsUserLicenseGracePeriod
[-Identity] <String>
[-Capability <String>]
-InputObject <IConfigApiBasedCmdletsIdentity>
[-Action <String>]
-Body <IUserDelicensingAccelerationPatch>
[-PassThru]
[-Force]
[-WhatIf]
[-Confirm]
[<CommonParameters>]

Parameters (7)

ParameterTypeRequiredWhat it controls
-Action String Used to specify which action should be taken.
-Body IUserDelicensingAccelerationPatch yes Specifies the body of the request.
-Capability String Denotes the plan(s) assigned to the specified user, which are to be permanently deleted if they are currently serving their grace period.
-Confirm SwitchParameter Prompts you for confirmation before running the cmdlet.
-Identity String yes Specifies the Identity (GUID) of the user account whose assigned plan grace period needs to be removed, permanently deleting the subsequent plan.
-InputObject IConfigApiBasedCmdletsIdentity yes The Identity parameter.
-PassThru SwitchParameter Returns the results of the command. By default, this cmdlet does not generate any output.

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