Goal: create a new user and assign him only a specific set of licenses
Prerequisites:
- http://www.microsoft.com/en-us/download/details.aspx?id=41950 –> Microsoft Online Services Sign-In Assistant for IT Professionals RTW
- https://msdn.microsoft.com/en-us/library/azure/jj151815.aspx#bkmk_installmodule –> Azure AD PowerShell
- http://www.microsoft.com/en-us/download/details.aspx?id=35588 –> SPO Management Shell
Let’s conect
1 2 |
$cred=get-credentials connect-msolservice -credentials $cred |
supply your Global Admin credentials after get-credentials
Let’s see what type of plan we have
1 2 3 4 5 |
Get-MsolAccountSku AccountSkuId ActiveUnits WarningUnits ConsumedUnits ------------ ----------- ------------ ------------- suz365:ENTERPRISEPACK 25 0 5 |
so we are on an E3 plan, with 25 licenses and only 5 are used.
Let’s create a new user
1 2 3 4 5 |
New-MsolUser -UserPrincipalName johndoe@suz365.onmicrosoft.com -DisplayName "John Doe" Password UserPrincipalName DisplayName isLicensed -------- ----------------- ----------- ---------- xxxxxxxxx johndoe@suz365.o... John Doe False |
We need to set a location for this user (otherwise, we can’t assign him a license)
1 |
Set-MsolUser -UserPrincipalName johndoe@suz365.onmicrosoft.com -UsageLocation RO |
Assign a license to the user
1 |
Set-MsolUserLicense -UserPrincipalName johndoe@suz365.onmicrosoft.com -AddLicenses suz365:ENTERPRISEPACK |
As you can see, now the user has the whole subset of licenses available in the EnterprisePack.
Now what does the EnterprisePack contain ?
1 2 3 4 5 6 7 8 9 10 11 |
Get-MsolAccountSku | Where-Object {$_.SkuPartNumber -eq'ENTERPRISEPACK'} | ForEach-Object {$_.ServiceStatus} ServicePlan ProvisioningStatus ----------- ------------------ YAMMER_ENTERPRISE PendingInput RMS_S_ENTERPRISE Success OFFICESUBSCRIPTION Success MCOSTANDARD Success SHAREPOINTWAC Success SHAREPOINTENTERPRISE Success EXCHANGE_S_ENTERPRISE Success |
That would mean:
- OFFICESUBSCRIPTION – Office Professional Plus
- MCOSTANDARD – Lync Online
- SHAREPOINTWAC – Microsoft Office Web Apps
- SHAREPOINTENTERPRISE – SharePoint Online
- EXCHANGE_S_ENTERPRISE – Exchange Online
Let’s say we want to remove Office ProPlus and Lync for our user:
1 2 3 |
$options=New-MsolLicenseOptions -AccountSkuId suz365:ENTERPRISEPACK -DisabledPlans MCOSTANDARD, OFFICESUBSCRIPTION Set-MsolUserLicense -UserPrincipalName johndoe@suz365.onmicrosoft.com -LicenseOptions $options |
There you go 🙂