You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I hope the titel is alright, please tell me if I should change it if it is unclear.
When running the command Set-MgUserLicense -UserId "great@account.com" -RemoveLicenses @("b70a4eeb-32f6-4c99-af47-3c822a4bbc59") -AddLicenses @() as described for example in Example 6 in the MS docs, the Graph SDK detects that -AddLicenses @() is essentially empty and omits it from the HTTP request. However, the Microsoft Graph API requires that AddLicensesis present even though it is empty. The same behavior can be reproduced with RemoveLicenses
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
POST
Absolute Uri:
https://graph.microsoft.com/v1.0/users/REDACTED/microsoft.graph.assignLicense
Headers:
FeatureFlag : 00000003
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows 10.0.26100; de-DE),PowerShell/7.5.0
SdkVersion : graph-powershell/2.26.1
client-request-id : REDACTED
Accept-Encoding : gzip,deflate,br
Body:
{}
an empty body and therefor in the error
Set-MgUserLicense_AssignExpanded: One or more parameters of the operation 'assignLicense' are missing from the request payload. The missing parameters are: addLicenses,removeLicenses.
Status: 400 (BadRequest)
ErrorCode: Request_BadRequest
Date: 2025-04-15T10:59:24
. The command Set-MgGroupLicense has the exact same issue. I am using Graph SDK 2.26.1.
Expected behavior
The SDK should neither omit AddLicenses, nor RemoveLicenses
How to reproduce
See section "Describe the bug"
SDK Version
2.26.1
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered:
Hi @dt-flo apologies for the inconvenience. This issue was already reported hereand the fix for it will be available by end of next week. I'll therefore close this as a duplicate
Describe the bug
I hope the titel is alright, please tell me if I should change it if it is unclear.
When running the command
Set-MgUserLicense -UserId "great@account.com" -RemoveLicenses @("b70a4eeb-32f6-4c99-af47-3c822a4bbc59") -AddLicenses @()
as described for example in Example 6 in the MS docs, the Graph SDK detects that-AddLicenses @()
is essentially empty and omits it from the HTTP request. However, the Microsoft Graph API requires thatAddLicenses
is present even though it is empty. The same behavior can be reproduced withRemoveLicenses
Example:
Set-MgUserLicense -UserId "great@account.com" -RemoveLicenses @() -AddLicenses @() -Debug
results inan empty body and therefor in the error
. The command
Set-MgGroupLicense
has the exact same issue. I am using Graph SDK 2.26.1.Expected behavior
The SDK should neither omit
AddLicenses
, norRemoveLicenses
How to reproduce
See section "Describe the bug"
SDK Version
2.26.1
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: