Open forsteri95 opened 1 year ago
Connect-AzureAD
$groupName = "Group Name" $licenseName = "License Name"
$group = Get-AzureADGroup -SearchString $groupName
$license = Get-AzureADSubscribedSku | Where-Object {$_.SkuPartNumber -eq $licenseName}
$licenseAssignment = New-AzureADGroupLicenseAssignment -ObjectId $group.ObjectId -SkuId $license.SkuId
Connect to Azure AD
Connect-AzureAD
Set variables for the group and license to be assigned
$groupName = "Group Name" $licenseName = "License Name"
Get the group object
$group = Get-AzureADGroup -SearchString $groupName
Get the license object
$license = Get-AzureADSubscribedSku | Where-Object {$_.SkuPartNumber -eq $licenseName}
Assign the license to the group
$licenseAssignment = New-AzureADGroupLicenseAssignment -ObjectId $group.ObjectId -SkuId $license.SkuId