- Mastering Office 365 Administration
- Thomas Carpe Nikkia Carter Alara Rogers
- 335字
- 2021-06-25 22:09:22
Adjusting the user's licenses
For a single user, the Product licenses section will display a brief summary of their assigned plans. This is useful mainly in cases where the user has only a few licenses assigned, since the list will be truncated after it reaches four or five items. Clicking the edit link to the right of this section will bring up a dialog that is very much like the one used when creating a new user. You can unassign licenses currently allocated to the user, or assign new ones. While you can often do both in a single step, there are cases where the license assignments will have dependencies or other requirements that will force you to perform the reassignment in multiple steps. For these cases, PowerShell is often a better option:

Editing licenses for single/multiple user(s)
The bulk options for editing licenses are somewhat limited. You can add to the user's existing licenses, or you may choose to replace the existing licenses entirely. Replacing licenses will offer you the ability to remove all licenses for the selected group of users. Unfortunately, there's no option available to remove a given license from all selected users. This can make certain license changes difficult to do in bulk, such as if you need to unassign any E3 license and assign an E5. In such cases, PowerShell is probably your best option short of making changes one user at a time.
To make license changes in PowerShell, unfortunately, there's no -LicenseAssignment parameter for the Set-MsolUser command. Instead, we make use of the Set-MsolUserLicense command. In this command, -AddLicenses and -RemoveLicenses can both accept arrays of strings that correspond to SKU part numbers, as we described for creating users.
The simplest way to add an E3 license is like so:
Set-MsolUserLicense -UserPrincipalName "jdeer@liquidhgdev.onmicrosoft.com" -AddLicenses "tenant_id:ENTERPRISEPACK"
Likewise, to remove it:
Set-MsolUserLicense -UserPrincipalName "jdeer@liquidhgdev.onmicrosoft.com" -RemoveLicenses "tenant_id:ENTERPRISEPACK"
There are a myriad other ways to accomplish the same task in PowerShell. For now, we'll leave those to your imagination and curiosity.