Overview
1. Browse to MOP (http://portal.microsoftonline.com) and sign into your Office 365 tenant
2. On the Admin tab of MOP, click Users under Management
3. Check the checkbox next to a user account in the Users list
4. Click Edit in the toolbar at the top
Note: You can also simply click the individual user name to get to the licensing screen. The checkboxes are useful when assigning licenses for multiple users.
5. Check the checkbox next to your plan (i.e. - Microsoft Office 365 Plan E3)
6. Check all of the checkboxes next to Office, Lync, Office Web Apps, SharePoint, and Exchange
7. Click Save
1. Check the checkbox next to multiple user accounts in the Users list
2. Click Edit in the toolbar at the top
3. Click Next twice since we are not making any Details or Settings changes
4. You should now be on the Licenses screen with 3 options:
a. Retain current license assignments
b. Replace existing license assignments
c. Add to existing license assignments
5. Select Replace existing license assignments and check the checkboxes for all available workloads:
6. Click Submit and click Finish
1. Launch Microsoft Online Services Module for Windows PowerShell
2. Connect-MsolService
3. Type your tenant Global Administrator credentials in the pop-up
Note: If there is a newer version of the PowerShell module, you will see yellow warning text explaining that a newer version is available. We should always be sure that we are running the latest version of the module.
4. We need to obtain the AccountSkuId values so that we are licensing within a licensing pack that the tenant is set up for. In our example here, we have an E3 trial tenant, which has an ENTERPRISEPACK AccountSkuId prefixed with our tenant name, which contains:
a. OFFICESUBSCRIPTION (Office 2010)
b. MCOSTANDARD (Lync Online)
c. SHAREPOINTWAC (SharePoint Online)
d. SHAREPOINTENTERPRISE (SharePoint Online)
e. EXCHANGE_S_ENTERPRISE (Exchange Online)
Get-MsolAccountSku
You’ll see the AcountSkuId, ActiveUnits, WarningUnits, and ConsumedUnits.
Get-MsolAccountSku | Format-Table AccountSkuId, SkuPartNumber
The second column in this list is referenced in the next command as SkuPartNumber. We only have ENTERPRISEPACK, but need to keep in mind that you may have multiple packs to choose from. Replace SkuPartNumber in the following command with ENTERPRISEPACK.
$ServicePlans = Get-MsolAccountSku | Where {$_.SkuPartNumber -eq "SkuPartNumber"}
$ServicePlans.ServiceStatus
This returns all the service plans. We will choose to disable MCOSTANARD (Lync Online). The cmdlet we use to set user licenses requires a LicenseOption object as input. The following command gets us a LicenseOption object
$myO365Sku = New-MsolLicenseOptions -AccountSkuId your-tenant-name:ENTERPRISEPACK -DisabledPlans MCOSTANDARD
$myO365Sku.GetType()
Notice this is a LicenseOption object.
5. Next, we can assign licenses to a user object
Users must have a UsageLocation value set prior to accepting licensing. UsageLocation is a 2-letter value representing the country in which the user will utilize the account:
Set-MSOLUser –UserPrincipalName your-user-UPN –UsageLocation US
Set the licensing. The following command will assign all licenses for the ENTERPRISEPACK:
Set-MsolUserLicense -UserPrincipalName your-user-UPN -AddLicenses your-tenant-name:ENTERPRISEPACK
Note: Similar to the –AddLicenses parameter, Set-MsolUserLicense also has a –RemoveLicenses parameter which can be used to remove license packs from a user object.
Finally, we need to disable Lync Online for this user:
Set-MsolUserLicense -UserPrincipalName your-user-UPN –LicenseOptions $myO365Sku
6. Let’s take a look at a user who has licensing added to get a feel for what the object should look like in PowerShell when the user object has been licensed for at least one workload. Your Global Administrator account is a good choice.
Get-MsolUser –UserPrincipalName “your-Global-Admin-UPN”
Notice that the default view shows us a column that shows isLicensed = True. This means that this object has been licensed for at least one workload.
Get-MsolUser –UserPrincipalName “your-Global-Admin-UPN” | Format-List
This shows us several of the object’s attributes and their values. Notice that the Licenses attribute shows us the value of the AccountSkuId. Let’s dig further into the Licenses property to see what else we can find out about how this user is licensed:
$existingLicense = (Get-MsolUser –UserPrincipalName “your-Global-Admin-UPN” ).Licenses
$existingLicense.GetType()
Notice that this is a List object. If you run $existingLicense.Count, you’ll see that it has just one item in the list.
Next, we’ll break apart the list item:
$existingLicenseDetail = $existingLicense[0]
You can now see all of the properties of our new variable by appending it with a “.” and tabbing through the property list:
$existingLicenseDetail. (use the Tab key to cycle through the property list)
We can see that $existingLicenseDetail is a UserLicense object by running:
$existingLicenseDetail.GetType()
We can see the AccountSkuId for this user’s licenses:
$existingLicenseDetail.AccountSkuId
We can see the licensed workloads and also the provisioning status for each workload:
$existingLicenseDetail.ServiceStatus
Our Global Administrator shows that he is licensed for all available workloads and the ProvisioningStatus shows a Success status for each workload:
Finally, here is a one-liner which will show you licensing for a specific user:
(Get-MSOLUser –UserPrincipalName your-user-UPN).Licenses[0].ServiceStatus
Try the one-liner command to verify that you successfully licensed your user for everything in ENTERPRISEPACK except Lync Online:
1. Set $myO365Sku so that there are no service plans disabled
$myO365Sku = New-MsolLicenseOptions –AccountSkuId your-tenant-name-ENTERPRISEPACK
Dump out $myO365Sku so you can see that DisabledServicePlans is $null
$myO365Sku
2. Set UsageLocation for all of your users
You can pipe the output from Get-MsolUser as input to another cmdlet which normally requires you to specify a user object:
Get-MsolUser -All | Set-MsolUser –UsageLocation US
3. License all of your users for everything in ENTERPRISEPACK
The following command will error for any user who has a license in the ENTERPRISEPACK already:
Get-MsolUser -All | Set-MsolUserLicense -AddLicenses your-tenant-name:ENTERPRISEPACK
Set LicenseOptions to ensure that all users are licensed for all workloads in the ENTERPRISEPACK:
Get-MsolUser -All | Set-MsolUserLicense –LicenseOptions $myO365Sku
Note: Rather than set licensing for all users, PowerShell offers you the flexibility to filter user objects so that you are licensing only a subset of your user base. Filter example:
Get-MsolUser -All | where {$_.UserPrincipalName -match "contoso.com"} | Set-MsolUserLicense -LicenseOptions $myO365Sku