PowerShell cmdlets to manage Azure AD group based licensing. Cmdlets use the internal Azure portal API which is not supported by Microsoft.
- Install the module:
Install-Module -Name AzureADLicensing -AllowClobber
- If you have the deprecated AzureRM module installed, uninstall it first
Uninstall-AzureRm
- If you have the deprecated AzureRM module installed, uninstall it first
- Authenticate to your Azure tenant:
Connect-AzAccount
- Feel free to use a service principal for unattended authentication and automation
All critical commands which modify settings support the -WhatIf
parameter to predict changes.
Get available licenses and services:
Get-AADLicenseSku
Get included service plans for a license:
$m365= Get-AADLicenseSku | Where-Object {$_.name -match "Microsoft 365 E5"}
$m365.serviceStatuses.servicePlan
Add new license assignment:
Add-AADGroupLicenseAssignment -groupId "a5e95316-1c03-44d7-afac-efd0e788122c" -accountSkuId "nicolasuter:FLOW_FREE"
Add license assignmnet with disabled plan:
Add-AADGroupLicenseAssignment -groupId 0a918505-d0d5-4078-9891-0e8bec67cb65 -accountSkuId "nicolasuter:SPE_E5" -disabledServicePlans @("MYANALYTICS_P2")
Update license assignment:
Update-AADGroupLicenseAssignment -groupId "a5e95316-1c03-44d7-afac-efd0e788122c" -accountSkuId "nicolasuter:FLOW_FREE"
Remove license assignment:
Remove-AADGroupLicenseAssignment -groupId "a5e95316-1c03-44d7-afac-efd0e788122c" -accountSkuId "nicolasuter:FLOW_FREE"
Get license assignments for a specific group:
Get-AADGroupLicenseAssignment -groupId "a5e95316-1c03-44d7-afac-efd0e788122c"
Get all group based licensing assignments:
Get-AADGroupLicenseAssignment -All