Edit

Set-SubscriptionLicenseInfo

Sets the subscription license configuration.

Syntax

__AllParameterSets

Set-SubscriptionLicenseInfo
    [-Enabled] <Boolean>
    [-AsJob]

Description

The Set-SubscriptionLicenseInfo cmdlet enables or disables Windows subscription licensing. Set Enabled to $true to enable subscription licensing or $false to disable it.

This cmdlet is available on systems that include the OSLicense module.

Note

Set-SubscriptionLicenseInfo is available in Windows Server vNext Preview Build 29651 and the 2026-09 security update for Windows 11 (KB5124008).

Examples

Example 1: Enable subscription licensing

This command requests that Windows enable subscription licensing.

Caution

This operation changes the system's subscription licensing configuration. Confirm the intended state before you run the command.

Set-SubscriptionLicenseInfo -Enabled $true

Example 2: Disable subscription licensing

This command requests that Windows disable subscription licensing.

Caution

This operation changes the system's subscription licensing configuration. Confirm the intended state before you run the command.

Set-SubscriptionLicenseInfo -Enabled $false

Parameters

-AsJob

Runs the command as a background job. The implicit-remoting wrapper adds this parameter, but the underlying Set-SubscriptionLicenseInfo function doesn't declare it.

Parameter properties

Type:SwitchParameter
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Enabled

Enables or disables Windows subscription licensing. Set this parameter to $true to enable subscription licensing or $false to disable it.

Parameter properties

Type:Boolean
Default value:False
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

Inputs

None

This cmdlet doesn't accept pipeline input.

Outputs

PSCustomObject

When the operation succeeds, the cmdlet returns an object whose Success property is $true. The Operation property is EnableSubscription or DisableSubscription, depending on the value of Enabled.

If an exception occurs, the cmdlet returns $null and doesn't write an error record.

Job

When you use AsJob through an implicit-remoting wrapper, the cmdlet returns a job object. Use Receive-Job to retrieve the operation result after the job completes.

Notes

Run this cmdlet from an elevated PowerShell session because it changes system licensing configuration.

The cmdlet reads the subscription type from the SoftwareLicensingService CIM instance. The current implementation supports subscription type 0. It invokes ClipRenew.exe with either the enablesubscription or disablesubscription operation and suppresses the native command's output. An unsupported subscription type, a CIM error, a missing tool, or a nonzero native exit code causes the cmdlet to return $null.

The implicit-remoting wrapper adds the AsJob parameter to the command surface even though the source function doesn't define it.