License & Subscription Issues

Report Microsoft 365 User License and Service Status with PowerShell

Steve KSteve K Nov 25, 2026 869 views

Question details

Create a PowerShell report of Microsoft 365 service provisioning statuses for each user, with consistent CSV columns and blank fields for unassigned services.

Report Microsoft 365 User License and Service Status with PowerShell
Product
Microsoft 365 and Microsoft Graph PowerShell
Device & OS
not provided
Scenario
An administrator needs to review assigned service statuses across users in a Microsoft 365 tenant.
Observed behavior
The desired CSV has one row per user and a fixed column for each selected service, leaving the field blank when the service is not assigned.
Before you start

Sign in with an account that can read users and license assignments, and confirm that your organization allows the required Microsoft Graph permissions. Identify the service plan names you want as CSV columns; Microsoft 365 service plan names may differ from product display names.

Solution 1Recommended

Export a fixed-column service status report with Microsoft Graph PowerShell

Use this approach to report selected service plans for every user while keeping the same columns for licensed and unlicensed accounts.

The report uses a fixed list of service plan names. It fills each matching column with the provisioning status returned by Microsoft Graph and leaves the column blank when the user has no matching assigned plan. If multiple assignments return different statuses for the same plan, the report joins the distinct statuses with semicolons.

1
Install and connect

In PowerShell, run `Install-Module Microsoft.Graph -Scope CurrentUser` if the module is not installed. Then run `Connect-MgGraph -Scopes 'User.Read.All','LicenseAssignment.Read.All'` and complete sign-in and any required consent.

2
Check service plan names

Run `Get-MgSubscribedSku -All | Select-Object -ExpandProperty ServicePlans | Select-Object ServicePlanName, ServicePlanId -Unique` to inspect plans in your subscribed products. Choose the exact ServicePlanName values you want in the report.

3
Run the export script

Replace the example names in `$serviceColumns` with your chosen plan names, then run: $serviceColumns = @('EXCHANGE_S_ENTERPRISE', 'SHAREPOINTENTERPRISE', 'TEAMS1') $users = Get-MgUser -All -Property Id,DisplayName,UserPrincipalName -ErrorAction Stop $report = foreach ($user in $users) { $row = [ordered]@{ DisplayName = $user.DisplayName UserPrincipalName = $user.UserPrincipalName } foreach ($column in $serviceColumns) { $row[$column] = '' } $details = Get-MgUserLicenseDetail -UserId $user.Id -ErrorAction Stop $plans = @($details | ForEach-Object { $_.ServicePlans }) foreach ($column in $serviceColumns) { $statuses = @($plans | Where-Object { $_.ServicePlanName -eq $column } | ForEach-Object { $_.ProvisioningStatus } | Where-Object { $_ } | Select-Object -Unique) $row[$column] = $statuses -join '; ' } [pscustomobject]$row } $report | Export-Csv -Path './user-service-status.csv' -NoTypeInformation -Encoding UTF8

4
Review the CSV

Open `user-service-status.csv` from PowerShell's current directory in a spreadsheet application. Check that its service columns match your selected plan names and that unassigned plans are blank.

Export a fixed-column service status report with Microsoft Graph PowerShell
Blank fields: A blank means no matching assigned service plan was returned for that user. The script stops on a user or license-detail retrieval error rather than treating an error as an unlicensed service.
Free Microsoft Office alternative

Review your Microsoft 365 service status CSV in WPS Spreadsheets

WPS Office is a free, lightweight alternative for opening and reviewing the exported report. Its familiar spreadsheet interface and format compatibility make it easy to move between Office files. Microsoft Graph PowerShell is still required to collect Microsoft 365 license data.

Open and review the exported service status CSV in a spreadsheetCompatible with Microsoft Excel XLSX and XLS filesUse a familiar interface for sorting and filtering report columnsFree and lightweight for everyday document work
microsoft office alternative - wps office

Frequently Asked Questions

How do I find the correct service plan names?

Run `Get-MgSubscribedSku -All | Select-Object -ExpandProperty ServicePlans | Select-Object ServicePlanName, ServicePlanId -Unique` after connecting to Microsoft Graph. Copy the desired ServicePlanName values into `$serviceColumns`.

Why is a service status field blank?

The field is blank when Microsoft Graph returns no assigned service plan matching that column for the user. Check the spelling of the plan name and the user's license assignments.

Will a disabled service appear as a blank?

Not necessarily. If Microsoft Graph returns the assigned plan with a provisioning status, the script writes that status. A blank is reserved for a column with no matching returned status.

What permissions does the PowerShell connection need?

The example requests `User.Read.All` and `LicenseAssignment.Read.All` with `Connect-MgGraph`. Your organization may require an administrator to grant consent before the commands can read users and license details.