Table of contents
TLS
TOC
Collapse the table of content
Expand the table of content

Convert-License

Last Updated: 4/3/2017

SYNOPSIS

Converts licenses in a key pack to per-device or per-user licenses.

SYNTAX

Convert-License -KeyPackId <UInt32> [-Count <UInt32>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

The Convert-License cmdlet converts licenses in a specified key pack. A key pack contains a number of licenses that enable clients to connect to a Remote Desktop Session Host (RD Session Host) server. Remote Desktop Licensing (RD Licensing) supports the following kinds of licenses:

  • Per-device. RD Licensing requires a license for each device that connects to an RD Session Host server.
  • Per-user. RD Licensing requires a license for each user that connects to an RD Session Host server.

If a key pack contains per-device licenses, this cmdlet converts them to per-user licenses. If a key pack contains per-user licenses, this cmdlet converts them to per-device licenses. This cmdlet returns an object corresponding to the new key pack.

You can specify how many licenses in the key pack to convert by using the Count parameter. If the number that you specify is greater than the number of available unissued keys, the cmdlet raises an error. If you do not specify a value for this parameter, this cmdlet converts all the licenses in the key pack.

EXAMPLES

Example 1: Convert all the licenses in a key pack

PS C:\> $KeyPack = Get-WmiObject -Class Win32_TSLicenseKeyPack
PS C:\> Convert-License -KeyPackId $KeyPack[2].KeyPackId

This example converts all the unissued licenses in a key pack to per-device or per-user licenses.

The first command gets all the license key packs on the current computer by using the Get-WmiObject cmdlet, and then stores them as an array in the $KeyPack variable. For more information, type Get-Help Get-WmiObject.

The second command uses standard array notation to specify the third member of the $KeyPack array. The command specifies the KeyPackId property of that key pack as the value for the KeyPackId parameter. The command converts the licenses in that key pack. To see all the properties of a key pack, use the Get-Member cmdlet. For more information, type Get-Help Get-Member.

PARAMETERS

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Count

Specifies the number of licenses that this cmdlet converts.

Type: UInt32
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-KeyPackId

Specifies the ID for a key pack.

Type: UInt32
Parameter Sets: (All)
Aliases: 

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

Get-RDLicenseConfiguration

Get-RDSessionHost

Get-WmiObject

Get-Member

© 2017 Microsoft