< Back
Set-PartnerCustomerUserLicense
Post
NAME Set-PartnerCustomerUserLicense
SYNOPSIS
Adds or removes licenses for a Microsoft online service to the list of assigned licenses for a user.
SYNTAX
Set-PartnerCustomerUserLicense -CustomerId <String> -LicenseUpdate <PSLicenseUpdate> -UserId <String> [-Confirm]
[-WhatIf] [<CommonParameters>]
DESCRIPTION
Adds or removes licenses for a Microsoft online service to the list of assigned licenses for a user.
PARAMETERS
-CustomerId <String>
The identifier for the customer.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-LicenseUpdate <PSLicenseUpdate>
The information used to update the license assignments.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-UserId <String>
The identifier for the user.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
Microsoft.Store.PartnerCenter.PowerShell.Models.Licenses.PSLicenseUpdate
NOTES
-------------------------- 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 '67e57a6a-6f26-4d6c-af64-533bb7f6a99e'
Adds or removes licenses for a Microsoft online service to the list of assigned licenses for a user.
RELATED LINKS
Online Version: https://docs.microsoft.com/powershell/m ... serLicense
SYNOPSIS
Adds or removes licenses for a Microsoft online service to the list of assigned licenses for a user.
SYNTAX
Set-PartnerCustomerUserLicense -CustomerId <String> -LicenseUpdate <PSLicenseUpdate> -UserId <String> [-Confirm]
[-WhatIf] [<CommonParameters>]
DESCRIPTION
Adds or removes licenses for a Microsoft online service to the list of assigned licenses for a user.
PARAMETERS
-CustomerId <String>
The identifier for the customer.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-LicenseUpdate <PSLicenseUpdate>
The information used to update the license assignments.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-UserId <String>
The identifier for the user.
Required? true
Position? named
Default value None
Accept pipeline input? False
Accept wildcard characters? false
-Confirm [<SwitchParameter>]
Prompts you for confirmation before running the cmdlet.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
-WhatIf [<SwitchParameter>]
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Required? false
Position? named
Default value False
Accept pipeline input? False
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).
INPUTS
None
OUTPUTS
Microsoft.Store.PartnerCenter.PowerShell.Models.Licenses.PSLicenseUpdate
NOTES
-------------------------- 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 '67e57a6a-6f26-4d6c-af64-533bb7f6a99e'
Adds or removes licenses for a Microsoft online service to the list of assigned licenses for a user.
RELATED LINKS
Online Version: https://docs.microsoft.com/powershell/m ... serLicense