I want to enable Microsoft365 service plans which user licenses specify. However, Update-MgUserLicenseDetail
command raises an Error.
The commands executed:
$userId='XXXX'
$skuId='XXXX'
$ServicePlanId='c1ec4a95-1f05-45b3-a911-aa3fa01094f5'
$ServicePlanName='INTUNE_A'
$licenseDetailsId='XXXX'
$servicePlans=@{AppliesTo="User"
ProvisioningStatus="Success"
ServicePlanId=$servicePlanId
ServicePlanName=$servicePlanName}
$params=@{ServicePlans = $servicePlans
SkuId = $skuId}
Update-MgUserLicenseDetail -LicenseDetailsId $licenseDetailsId -UserId $userId -BodyParameter $params -Debug
The error:
Update-MgUserLicenseDetail : Filtered searches against this resource are not supported.
Is there something wrong with the way to use Update-MgUserLicenseDetail
?
I don't understand fully the differences between Update-MgUserLicenseDetail
and Set-MgUserLicense
.
Using Set-MgUserLicense
, is it able to enable service plans of MS365?
Documents I checked:
microsoft.graph.users/update-mguserlicensedetail
microsoft.graph.users.actions/set-mguserlicense
Powershell - Update-MgUserLicenseDetail : Filtered searches against this resource are not supported