To assign licenses to a group of Windows client devices in Microsoft Entra ID, follow these steps:
- Identify the Group: Ensure you have a group in Microsoft Entra ID that contains your Windows client devices.
- Access Intune Admin Center: Go to the Microsoft Intune admin center (https://endpoint.microsoft.com/).
- Navigate to Devices: Go to "Devices" > "All devices".
- Filter by Group: Use the filter options to display only the devices that are members of your group.
- Select Devices: Select all the devices in the filtered list.
- Assign Licenses: Click on "Assign license" and select the appropriate license (e.g., Windows 10/11 Enterprise).
- Verify Assignment: Verify that the licenses have been assigned to the devices.
If you need to automate this process, you might need to use the Intune Graph API or a combination of PowerShell and Intune APIs to achieve this.
Here's a PowerShell script example that uses the Microsoft Graph API to get the devices in a group. Note that assigning licenses to devices might require additional steps or APIs:
# Install the Microsoft Graph PowerShell module if not already installed
Install-Module Microsoft.Graph -Scope CurrentUser -Force
# Connect to Microsoft Graph with the necessary permissions
Connect-MgGraph -Scopes "DeviceManagementManagedDevices.ReadWrite.All", "Organization.Read.All", "DeviceManagementServiceConfig.ReadWrite.All"
# Get the group
$groupName = "YourGroupName"
$group = Get-MgGroup -Filter "displayName eq '$groupName'"
if (-not $group) {
Write-Host "Group not found."
exit
}
# Get the members of the group that are devices
$members = Get-MgGroupMember -GroupId $group.Id
$devices = $members | Where-Object { $_.OdataType -eq "#microsoft.graph.device" }
if (-not $devices) {
Write-Host "No devices found in the group."
exit
}
# Get the license SKU (e.g., Windows 10/11 Enterprise)
$licenseSku = Get-MgSubscribedSku | Where-Object { $_.SkuPartNumber -eq "WIN_ENT" }
if (-not $licenseSku) {
Write-Host "License SKU not found."
exit
}
# Assign the license to each device
foreach ($device in $devices) {
$deviceId = $device.Id
$licenseAssignment = @{
skuId = $licenseSku.SkuId
disabledPlans = @() # You can specify which plans to disable if needed
}
try {
Write-Host "Assigning license to device: $($device.DisplayName)"
# Note: Replace this with the actual API call to assign licenses to devices
# Example: Invoke-MgGraphRequest -Method POST -Uri "https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/$deviceId/assignLicense" -BodyParameter $licenseAssignment
} catch {
Write-Host "Failed to assign license to device: $($device.DisplayName)"
}
}
For a more automated approach, consider using the Intune Graph API or consult Microsoft's documentation for the most up-to-date methods to assign licenses to devices.
This approach ensures that all devices in the specified group receive the necessary licenses. If you encounter any issues or need further assistance, please let me know!