I'm trying to assign license to user in Office365 like I would do with powershell
Set-MsolUserLicense -UserPrincipalName [email protected] -AddLicenses licenseName
But the difference is that I'm trying to do it with Microsoft Graph.
My URL is following:
https://graph.microsoft.com/beta/users('[email protected]')/
And my json is following:
{ "assignedLicenses": [
{
"skuId": "myID"
}
]
}
But in response I'm getting following message:
{ "error": { "code": "Request_BadRequest", "message": "Property 'assignedLicenses' is read-only and cannot be set.", "innerError": { "request-id": "myID", "date": "2016-03-31T09:07:34" } } }
The question is how do I work around this issue and actually set license? Or there is no way yo work around this?