Adds or removes licenses for a Microsoft online service to the list of assigned licenses for a user.
Esempio
Example 1
PS C:\> # Create the objects that will be needed
PS C:\> $license = New-Object -TypeName Microsoft.Store.PartnerCenter.PowerShell.Models.Licenses.PSLicenseAssignment
PS C:\> $licenses = New-Object -TypeName Microsoft.Store.PartnerCenter.PowerShell.Models.Licenses.PSLicenseUpdate
PS C:\>
PS C:\> # Find the SkuId of the license we want to add - in this example we will use the O365_BUSINESS_PREMIUM license
PS C:\> $license.SkuId = (Get-PartnerCustomerLicense -CustomerId '46a62ece-10ad-42e5-b3f1-b2ed53e6fc08' | Where-Object -Property SkuPartNumber -Value "O365_BUSINESS_PREMIUM" -EQ).SkuId
PS C:\>
PS C:\> # Add the license to the update statement.
PS C:\> $licenses.LicensesToAssign.Add($license)
PS C:\>
PS C:\> # Call the command to update the license assignment.
PS C:\> Set-PartnerCustomerUserLicense -CustomerId '46a62ece-10ad-42e5-b3f1-b2ed53e6fc08' -LicenseUpdate $licenses -UserId '00aa00aa-bb11-cc22-dd33-44ee44ee44ee'
Adds or removes licenses for a Microsoft online service to the list of assigned licenses for a user.
Parametri
-Confirm
Prompts you for confirmation before running the cmdlet.
Proprietà dei parametri
Tipo:
SwitchParameter
Valore predefinito:
None
Supporta i caratteri jolly:
False
DontShow:
False
Alias:
cf
Set di parametri
(All)
Posizione:
Named
Obbligatorio:
False
Valore dalla pipeline:
False
Valore dalla pipeline in base al nome della proprietà:
False
Valore dagli argomenti rimanenti:
False
-CustomerId
The identifier for the customer.
Proprietà dei parametri
Tipo:
String
Valore predefinito:
None
Supporta i caratteri jolly:
False
DontShow:
False
Set di parametri
(All)
Posizione:
Named
Obbligatorio:
True
Valore dalla pipeline:
False
Valore dalla pipeline in base al nome della proprietà:
False
Valore dagli argomenti rimanenti:
False
-LicenseUpdate
The information used to update the license assignments.
Proprietà dei parametri
Tipo:
PSLicenseUpdate
Valore predefinito:
None
Supporta i caratteri jolly:
False
DontShow:
False
Set di parametri
(All)
Posizione:
Named
Obbligatorio:
True
Valore dalla pipeline:
False
Valore dalla pipeline in base al nome della proprietà:
False
Valore dagli argomenti rimanenti:
False
-UserId
The identifier for the user.
Proprietà dei parametri
Tipo:
String
Valore predefinito:
None
Supporta i caratteri jolly:
False
DontShow:
False
Set di parametri
(All)
Posizione:
Named
Obbligatorio:
True
Valore dalla pipeline:
False
Valore dalla pipeline in base al nome della proprietà:
False
Valore dagli argomenti rimanenti:
False
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Proprietà dei parametri
Tipo:
SwitchParameter
Valore predefinito:
None
Supporta i caratteri jolly:
False
DontShow:
False
Alias:
wi
Set di parametri
(All)
Posizione:
Named
Obbligatorio:
False
Valore dalla pipeline:
False
Valore dalla pipeline in base al nome della proprietà:
False
Valore dagli argomenti rimanenti:
False
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable,
-InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable,
-ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see
about_CommonParameters.