Microsoft 365 licensing

How to export Microsoft 365 licensed users to CSV

Export licensed users with Microsoft Graph PowerShell, review them in the admin centre, or use Altivane's Users list for a repeatable CSV export.

By the Published Updated

To export licensed Microsoft 365 users, read users and their assigned licences with Microsoft Graph PowerShell, then write the results to CSV. You can also export the admin centre's user list or use the Users pane in Altivane.

Choose the method that fits the job
MethodBest fit
PowerShellA precise CSV with columns and logic you control.
Admin centreA quick export from a tenant you already have open.
AltivaneRecommended for repeat reviews, with each user's licences beside their details.

Before you start

Decide whether you need every licensed account or only enabled staff accounts. An assigned licence does not prove that someone is actively using the product. Keep sign-in status and licence assignment separate in your review.

For PowerShell, use the Microsoft Graph modules below and an account authorised to read users and tenant subscriptions. The example requests User.Read.All and Organization.Read.All; your organisation may require administrator consent. Confirm the selected tenant when signing in.

Option 1

Export licensed users with PowerShell

Install the modules once, then use the export script for each tenant review.

PowerShell
# Install these modules once, if they are not already installed.
Install-Module Microsoft.Graph.Users -Scope CurrentUser
Install-Module Microsoft.Graph.Identity.DirectoryManagement -Scope CurrentUser
PowerShell
$ErrorActionPreference = 'Stop'
Connect-MgGraph -Scopes 'User.Read.All', 'Organization.Read.All'
try {
    $skuNames = @{}
    Get-MgSubscribedSku -All | ForEach-Object {
        $skuNames[$_.SkuId.ToString()] = $_.SkuPartNumber
    }
    $users = Get-MgUser -All -Property DisplayName,UserPrincipalName,AccountEnabled,AssignedLicenses
    $report = @($users | Where-Object { $_.AssignedLicenses.Count -gt 0 } | ForEach-Object {
        $products = @($_.AssignedLicenses | ForEach-Object {
            $id = $_.SkuId.ToString()
            if ($skuNames.ContainsKey($id)) { $skuNames[$id] } else { $id }
        })
        [pscustomobject]@{
            DisplayName = $_.DisplayName
            UserPrincipalName = $_.UserPrincipalName
            AccountEnabled = $_.AccountEnabled
            Licences = $products -join '; '
        }
    })
    if ($report.Count -eq 0) { throw 'No licensed users returned. No CSV was written.' }
    $report | Sort-Object UserPrincipalName |
        Export-Csv -Path './licensed-users.csv' -NoTypeInformation -Encoding utf8
} finally {
    Disconnect-MgGraph
}

The CSV is written to your current folder. It contains 1 row per licensed user, with multiple product identifiers separated by semicolons. These are SKU names, such as SPE_E3, rather than Microsoft's full marketing names.

The script includes disabled accounts and licensed guests. Filter AccountEnabled in Excel if you need enabled accounts only. It reports assignments, not service provisioning success, product usage or the full detail of group-based licensing.

Option 2

Use the Microsoft 365 admin centre

  1. Open the Microsoft 365 admin centre and confirm the tenant.
  2. Go to Users > Active users and review the licence information for the accounts you need.
  3. Choose Export users. Depending on the current layout, this may be under the additional actions menu.
  4. Open the CSV in Excel and filter the licence column to keep accounts with an assigned product. Check the exported rows instead of assuming a screen filter carried into the export.

This is convenient for an occasional review. Exported columns and product labels can differ from a custom Graph report, so compare the same account scope when reconciling them.

Common questions

Why do disabled users appear in the export?

Blocking sign-in does not remove assigned licences. Keeping those accounts in the export helps you spot allocations to investigate, rather than silently excluding them.

Does a licensed account mean the licence is being used?

No. Check relevant usage and sign-in information separately. Do not remove a licence solely because it appears unnecessary in an assignment export.

Can I use the CSV for client reporting?

Yes. Record the tenant, collection date and account filters with the file so the recipient knows what the export covers. Use the mailbox sizes guide when the review also needs Exchange storage information.

Microsoft references

Technical references checked on 5 October 2026. The example script has been reviewed and syntax checked; it has not been run against a live tenant.

Talk to us about Altivane

Questions, or pricing? Get in touch.

Contact us