Hello @J#T02gv2in , thank you for reaching out. Can you try the following PS Script:
Connect-AzureAD
#Get User details
$userToSearch = Read-Host "Enter user to search"
$user = Get-AzureADUser -SearchString $userToSearch
#To assign the usage location to user
#Set-AzureADUser -ObjectId $user.ObjectId -UsageLocation IN
#Set the service plans with License to enable
$skuPlansToEnable = @("SHAREPOINTENTERPRISE","TEAMS1","POWERAPPS_O365_P3")
$license = Get-AzureADSubscribedSku | Where-Object {$_.SkuPartNumber -eq 'ENTERPRISEPREMIUM'}
$servicePlans = $license.ServicePlans
$skuPlansToDisable = ForEach-Object {$servicePlans | Where-Object {$_.ServicePlanName -notin $skuPlansToEnable}}
$licenseNew = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicense
$licenseNew.SkuId = $license.SkuId
$licenseNew.DisabledPlans = $skuPlansToDisable.ServicePlanId
$licensesToAssign = New-Object -TypeName Microsoft.Open.AzureAD.Model.AssignedLicenses
$licensesToAssign.AddLicenses = $licenseNew
Set-AzureADUserLicense -ObjectId $user.ObjectId -AssignedLicenses $licensesToAssign
#To view the assigned service plans
Get-AzureADUser -ObjectId $user.ObjectId | select -ExpandProperty AssignedPlans
Note: This script is for users who already have a license assigned and you want to add few more service plans from the already assigned license. If you intend to test this for a new user who doesn't have any license assigned yet, they make sure you enable line 8.
Hope this helps.
Do let us know if this helps and if there are any more queries around this, please do let us know so that we can help you further. Also, please do not forget to accept the response as an Answer; if the above response helped in answering your query.