Here's a step-by-step guide to assign licenses to a group of Windows client devices in Microsoft Entra ID:
Prerequisites
- Global Administrator or License Administrator role in Microsoft Entra ID
- Group containing Windows client devices
- Available licenses in your Microsoft 365 tenant
Method 1: Azure Portal (Recommended)
- Navigate to Microsoft Entra ID
# Open Azure Portal
Start-Process "https://entra.microsoft.com"
-
Go to Groups
- Click "Groups" in the left navigation
- Select the group containing your Windows client devices
-
Assign Licenses
- Click "Licenses" in the group's settings
- Click "+ Assign"
- Select the desired product licenses
- Review and confirm assignment
Method 2: PowerShell
# Install Microsoft Graph PowerShell Module (if not already installed)
Install-Module Microsoft.Graph -Scope CurrentUser
# Connect to Microsoft Graph with appropriate permissions
Connect-MgGraph -Scopes "Group.ReadWrite.All", "User.ReadWrite.All", "Organization.Read.All"
# Get the Group ID
$groupId = (Get-MgGroup -Filter "displayName eq 'Your Device Group Name'").Id
# Get License SKUs
$licensePlan = Get-MgSubscribedSku | Where-Object {$_.SkuPartNumber -eq "ENTERPRISEPACK"} # Example: Office 365 E3
# Assign License to Group
Set-MgGroupLicense -GroupId $groupId -AddLicenses @{
SkuId = $licensePlan.SkuId
} -RemoveLicenses @()
Method 3: Azure AD PowerShell Module (Legacy)
# Install Azure AD Module
Install-Module AzureAD
# Connect to Azure AD
Connect-AzureAD
# Get Group
$group = Get-AzureADGroup -SearchString "Your Device Group Name"
# Get License SKU
$license = Get-AzureADSubscribedSku | Where-Object {$_.SkuPartNumber -eq "ENTERPRISEPACK"}
# Assign License
Set-AzureADGroupLicense -ObjectId $group.ObjectId -AssignedLicenses @{
SkuId = $license.SkuId
}
Important Considerations
-
Group Type:
- Must be a security group
- Preferably dynamically populated with Windows client devices
-
License Assignment Modes
- Group-based licensing
- Automatic assignment to group members
- Conflicts are automatically resolved
-
Common License SKU Part Numbers
ENTERPRISEPACK: Office 365 E3
MICROSOFT_365_E5: Microsoft 365 E5
STANDARDPACK: Office 365 E1
Troubleshooting
# Check License Assignment Errors
Get-MgGroupLicenseError -GroupId $groupId
# Verify Group Members
Get-MgGroupMember -GroupId $groupId
Best Practices
- Use dynamic groups for automatic device management
- Regularly audit license assignments
- Implement least-privilege licensing
- Monitor license conflicts and errors
Sample Dynamic Group Query for Windows Devices
# Example dynamic group rule for Windows devices
(device.deviceOSType -eq "Windows")
Verification Steps
- Check group membership
- Verify license assignment
- Confirm devices have appropriate access
Note: Always test license assignments in a staged manner to prevent unintended consequences.