Enable Only Required Microsoft 365 License Service Plans
Question details
The user needs to enable only approved service plans when assigning Microsoft 365 licenses.

- Product
- Microsoft 365 licensing and Microsoft Graph PowerShell
- Device & OS
- not provided
- Scenario
- An administrator assigns licenses with PowerShell and wants newly added service plans excluded unless explicitly approved.
- Observed behavior
- New service plans may become enabled by default if the license assignment configuration is not updated.
Identify the license SKU, target user, and exact service plan names you want to enable. Use an account with the required Microsoft Entra licensing role and Microsoft Graph permissions, and check whether the license is assigned directly or through a group.
Use Microsoft Graph PowerShell to disable unapproved service plans
Use an allowlist to calculate which plans to disable for a directly assigned license, then rerun the process when plans change.
The script reads the plans currently available in the SKU and disables every plan not listed in the allowlist. It does not automatically run when Microsoft adds a plan; review and rerun your provisioning process to apply the updated configuration.
The legacy MSOnline module and its New-MsolLicenseOptions and Set-MsolUserLicense commands are retired. Use Microsoft Graph PowerShell for new licensing scripts.
In PowerShell, install the Microsoft.Graph module if needed with Install-Module Microsoft.Graph -Scope CurrentUser. Then run Connect-MgGraph -Scopes 'Organization.Read.All','User.Read.All','LicenseAssignment.ReadWrite.All' and grant the requested permissions.
Run Get-MgSubscribedSku -All | Select-Object SkuPartNumber, SkuId to find the license. Then run (Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq 'YOUR_SKU_PART_NUMBER').ServicePlans | Select-Object ServicePlanName, ServicePlanId to identify the exact names to allow.
Replace the placeholders in this PowerShell example and run it for a directly assigned license: $sku = Get-MgSubscribedSku -All | Where-Object SkuPartNumber -eq 'YOUR_SKU_PART_NUMBER' if (@($sku).Count -ne 1) { throw 'Expected exactly one matching SKU.' } $allowed = @('YOUR_REQUIRED_PLAN_NAME', 'YOUR_OTHER_REQUIRED_PLAN_NAME') $missing = @($allowed | Where-Object { $_ -notin $sku.ServicePlans.ServicePlanName }) if ($missing.Count -gt 0) { throw "Unknown service plans: $($missing -join ', ')" } $disabled = @($sku.ServicePlans | Where-Object { $_.ServicePlanName -notin $allowed } | ForEach-Object { $_.ServicePlanId }) Set-MgUserLicense -UserId 'USER_PRINCIPAL_NAME' -AddLicenses @(@{ SkuId = $sku.SkuId; DisabledPlans = $disabled }) -RemoveLicenses @()
Run Get-MgUserLicenseDetail -UserId 'USER_PRINCIPAL_NAME' and inspect the ServicePlans property. Include the allowlist calculation in your provisioning process and rerun it after SKU plans change.

Work with Office files using WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with documents, spreadsheets, and presentations. Its Office format support helps you move existing files into your workflow. It does not manage Microsoft 365 license service plans.

Frequently Asked Questions
How do I find the service plans included in a Microsoft 365 license?
In Microsoft Graph PowerShell, run Get-MgSubscribedSku -All, select the SKU by SkuPartNumber, and inspect its ServicePlans property for plan names and IDs.
Will the script automatically disable plans Microsoft adds later?
No. The allowlist calculation includes newly available plans the next time it runs. Schedule or rerun your provisioning process and verify the resulting assignment.
Can I use this script for a group-assigned license?
The example updates a direct user assignment. For a group-assigned license, change the disabled service plans on the licensing group in Microsoft Entra instead.
Why might a service remain enabled after I disable its plan?
Another direct or group-based license assignment may enable the same service. Check the user's license assignments and service plans in the Microsoft 365 admin center or Microsoft Entra admin center.
Should I still use New-MsolLicenseOptions?
No. The MSOnline module is retired. Use Microsoft Graph PowerShell and Set-MgUserLicense for direct user license assignments.




