Set-WssMsoUserLicense

Set-WssMsoUserLicense

Assigns licenses to an account in .

Syntax

Parameter Set: Default
Set-WssMsoUserLicense [-WssUserName] <String> [[-License] <MSOLicense[]> ] [ <CommonParameters>]

Detailed Description

The Set-WssMsoUserLicense cmdlet assigns licenses to an online service account in .

Parameters

-License<MSOLicense[]>

Specifies an array of licenses as MSOLicense objects. The cmdlet assigns the licenses that you specify to a user account. To obtain MSOLicense objects, use the Get-WssMsoSubscription cmdlet to get subscription information. Subscription information contains the MSOLicenseSuite array that refers to MSOLicense objects.

Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

True (ByPropertyName)

Accept Wildcard Characters?

false

-WssUserName<String>

Specifies the name of the user account to which you want the licenses assigned.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue, ByPropertyName)

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.String

    WssUserName
    Type: System.String
    Description: local network account name of user

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Store a license for a user

The first command uses the Get-WssMsoSubscription cmdlet to get subscription information, and then stores it in the $Subscribe variable.

The second command assigns a license, contained in the object stored in the $Subscribe variable, to the account named EvanNarvaez. The command uses standard array notation to access the first member of the MSOLicenseSuite array, and refer to the associated MSOLicense object.

PS C:\> $Subscribe = Get-WssMsoSubscription
PS C:\> Set-WssMSOUserLicense -WssUserName "EvanNarvaez" -License $Subscribe.MSOLicenseSuite[0].MSOLicense

Get-WssMsoSubscription