Office 365 License Option PowerShell

Office 365 License Option PowerShell

Hello,

Office 365 Licensing is divided in SKU, each SKU has Service Plan. They differ for each SKU. You can add an SKU to a user, without allowing access to all service plan, you can choose one by one the ones you want to enable for a given user.

We will see how to work with licensing in Office 365 with both the old PowerShell module, and the new one.

Office 365 SKU

You can get a list of the available SKU on your Office 365 tenant with :

Msol

Get-MsolAccountSku
Office 365 License Option PowerShell - MSOL Account SKU

Office 365 License Option PowerShell – MSOL Account SKU

AzureAD

Get-AzureADSubscribedSku
Office 365 License Option PowerShell - AzureAD Subscribed SKU

Office 365 License Option PowerShell – AzureAD Subscribed SKU

Available Service Plan

Inside each SKU, there is some Service Plan :

MSOL

Get-MsolAccountSku | Select-Object -ExpandProperty ServiceStatus
Office 365 License Option PowerShell - MSOL Service Plan

MSOL Service Plan

AzureAD

Get-AzureADSubscribedSku | Select-Object -ExpandProperty ServicePlans
Office 365 License Option PowerShell - AzureAD Service Plan

AzureAD Service Plan

Check Service Plan on user

Now, let’s check on a user with a license and disable plan :

MSOL

Get-MsolUser -UserPrincipalName dumbo@itfordummies.net | Select-Object -ExpandProperty Licenses | Select-Object -ExpandProperty ServiceStatus
Office 365 License Option PowerShell - MSOL User Service Plan

MSOL User Service Plan

AzureAD

Get-AzureADUser -SearchString dumbo | Select-Object -ExpandProperty AssignedPlans
Office 365 License Option PowerShell - AzureAD User Service Plan

AzureAD User Service Plan

Service Plans

MSOL

You can set license option by creating a MsolLicenseOptions with the required disabled plans, and then use it to set the license.

$Options = New-MsolLicenseOptions -AccountSkuId itfordummies:enterprisepack -DisabledPlans YAMMER_ENTERPRISE,RMS_S_ENTERPRISE
Set-MsolUserLicense -UserPrincipalName dumbo@itfordummies.net -LicenseOptions $options
Get-MsolUser -UserPrincipalName dumbo@itfordummies.net | Select-Object -ExpandProperty Licenses | Select-Object -ExpandProperty ServiceStatus
Office 365 License Option PowerShell - MSOL Set License Options

MSOL Set License Options

AzureAD

In this version (2.0.0.33), licenses plan assignment does not seem to be implemented, but you can set licenses with full plan assignment:

$AssignedLicense = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicense
$AssignedLicense.SkuId = '6fd2c87f-b296-42f0-b197-1e91e994b900'


$AssignedLicenses = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicenses
$AssignedLicenses.AddLicenses = $AssignedLicense

Set-AzureADUserLicense -ObjectId dumbo@itfordummies.net -AssignedLicenses $AssignedLicenses
Office 365 License Option PowerShell - AzureAD Set License

AzureAD Set License

Office 365 License Option PowerShell

So, there is two ways of managing AzureAD, as of today, one of the two is under active development.

If you need to disable some service plan to allow your company to embrace cloud change on its own speed, you need (for now) to use the MSOnline PowerShell module

 

Leave a Reply