View account license and service details with Office 365 PowerShell

Summary: Explains how to use Office 365 PowerShell to determine the Office 365 services that have been assigned to users.

In Office 365, licenses from licensing plans (also called SKUs or Office 365 plans) give users access to the Office 365 services that are defined for those plans. However, a user might not have access to all the services that are available in a license that's currently assigned to them. You can use Office 365 PowerShell to view the status of services on user accounts.

Before you begin

  • The procedures in this topic require you to connect to Office 365 PowerShell. For instructions, see Connect to Office 365 PowerShell.

  • Use the commands Get-MsolAccountSku and (Get-MsolAccountSku | where {$_.AccountSkuId -eq '<AccountSkuId>'}).ServiceStatus to find the following information:

    • The licensing plans that are available in your organization.

    • The services that are available in each licensing plan, and the order in which they are listed (the index number).

      For more information about licensing plans, license, and services, see View licenses and services with Office 365 PowerShell.

  • Use the command Get-MsolUser -UserPrincipalName <user account UPN> | Format-List DisplayName,Licenses to find the licenses that are assigned to a user, and the order in which they are listed (the index number).

  • If you use the Get-MsolUser cmdlet without using the All parameter, only the first 500 accounts are returned.

To view services for a user account

To view all the Office 365 services that a user has access to, use the following syntax:

(Get-MsolUser -UserPrincipalName <user account UPN>).Licenses[<LicenseIndexNumber>].ServiceStatus

This example shows the services to which the user BelindaN@litwareinc.com has access. This shows the services that are associated with all licenses that are assigned to her account.

(Get-MsolUser -UserPrincipalName belindan@litwareinc.com).Licenses.ServiceStatus

This example shows the services that user BelindaN@litwareinc.com has access to from the first license that's assigned to her account (the index number is 0).

(Get-MsolUser -UserPrincipalName belindan@litwareinc.com).Licenses[0].ServiceStatus

To view all the services for a user who has been assigned multiple licenses, use the following syntax:

$userAccountUPN="<user account UPN>"
$AllLicenses=(Get-MsolUser -UserPrincipalName $userAccountUPN).Licenses
$licArray = @()
for($i = 0; $i -lt $AllLicenses.Count; $i++)
{
$licArray += "License: " + $AllLicenses[$i].AccountSkuId
$licArray +=  $AllLicenses[$i].ServiceStatus
$licArray +=  ""
}
$licArray

See also

See the following additional topics about managing users with Office 365 PowerShell:

For more information about the cmdlets that are used in these procedures, see the following topics:

New to Office 365?

Tip

LinkedIn logo New to Office 365?

Discover free video courses for Office 365 admins and IT pros, brought to you by LinkedIn Learning.