Get-EaiO365LicenseInfoWithPlans

Module: Exchange_AddIn
Applies to: Azure AD licensing
Required: Log onto MS Graph API using the MS Graph PowerShell SDK. Permissions needed for Graph access: User.Read.All

Get-EaiO365LicenseInfoWithPlans

SYNOPSIS

List out all licenses and service plans for a given user.

SYNTAX

Get-EaiO365LicenseInfoWithPlans [[-Identity] <String>] [-unlimited] [<CommonParameters>]

DESCRIPTION

This script will list out all licenses and service plans for a given user.
It will also list out the service plan ID, which is needed to enable or disable a service plan.
This script requires the MsGraph PowerShell module.
Permissions needed fro Graph access: User.Read.All

EXAMPLES

EXAMPLE 1

Get-EaiO365LicenseInfoWithPlans -Identity "bob@contoso.com"

This will list out each license sku, its' title, and the service plans assigned to the user, Bob, in the Contoso tenant.

EXAMPLE 2

Get-EaiO365LicenseInfoWithPlans -Identity "mike@contoso.com" | Format-Table

This will list out in a table format, each license sku, its' title, and the service plans assigned to the user, Mike, in the Contoso tenant.

EXAMPLE 3

Get-EaiO365LicenseInfoWithPlans -unlimited

This will list out in a table format, each license sku, its' title, and the service plans assigned to all users in the current tenant.

EXAMPLE 4

Get-EaiO365LicenseInfoWithPlans -Identity "Diane@contoso.com" | Export-Csv -NoTypeInformation -Path c:\temp\plans.csv

This will export a CSV file to C:\temp with the license sku, its' title, and the service plans assigned to the user, Diane, in the Contoso tenant.

PARAMETERS

-Identity

Single Idendity for a specific user.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-unlimited

Allows to get information for all current users in a tenant.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

UserPrincipalName or 'unlimited' switch option for all users.

OUTPUTS

Output results to screen.

NOTES

Reference:
Start-Process https://learn.microsoft.com/en-us/microsoft-365/enterprise/view-account-license-and-service-details-with-microsoft-365-powershell?view=o365-worldwide#to-view-services-for-a-user-account

RELATED LINKS