Skip to content

Grant-EntraLicense

SYNOPSIS

Assigns Microsoft Entra licenses to users.

SYNTAX

Grant-EntraLicense [-UserPrincipalNames] <String[]> [-LicensePlan] <String> [<CommonParameters>]

DESCRIPTION

The `Grant-EntraLicense` function assigns Microsoft Entra licenses to specified users based on their User Principal Names (UPNs). It validates the compatibility of the requested license plan with the user's current license state and organizational unit. The function supports multiple license plans and handles group-based license assignments.

EXAMPLES

EXAMPLE 1

Grant-EntraLicense -UserPrincipalNames "[email protected]", "[email protected]" -LicensePlan "Teams"

Assigns the "Teams" license plan to the specified users.

EXAMPLE 2

Grant-DGO365License -UserPrincipalNames "[email protected]" -LicensePlan "Exchange Online"

Uses the alias `Grant-DGO365License` to assign the "Exchange Online" license plan to the specified user.

EXAMPLE 3

Grant-O365License -UserPrincipalNames "[email protected]" -LicensePlan "Planner"

Uses the alias `Grant-O365License` to assign the "Planner" license plan to the specified user.

PARAMETERS

-UserPrincipalNames

One or more UPNs of the users to whom the license will be assigned.

Type: String[]
Parameter Sets: (All)
Aliases:

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

-LicensePlan

The license plan to assign to the specified users. Supported values include: - Azure Rights Management - CDS - CDS for Teams - Exchange Online - Flow - Information Protection - Insights by MyAnalytics - Microsoft 365 Apps for Enterprise - Bookings - Forms - Kaizala - Planner - StaffHub - Stream - Teams - Office for the Web - Office Mobile Apps - Power Virtual Agents - PowerApps for Office - Project for Office - SharePoint - Sway - ToDo - Whiteboard - Yammer

Type: String
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
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

OUTPUTS

NOTES