msgraph-sdk-powershell icon indicating copy to clipboard operation
msgraph-sdk-powershell copied to clipboard

update-user : The OData request is not supported

Open baywet opened this issue 6 years ago • 4 comments

Repro

connect-graph -Scopes @("User.ReadWrite.All", "MailboxSettings.ReadWrite")
update-user -userId $Id -MailboxSettings @{"timeZone"="Eastern Standard Time"}

Error

update-user : The OData request is not supported

Intent

PATCH https://graph.microsoft.com/beta/users/id/mailboxSettings

{
"timeZone": "Eastern Standard Time"
}

Environment information

PS 5.1.18362.145 Windows 10 1903 18362.476 Microsoft.Graph.Beta 0.1.3

AB#7451

baywet avatar Nov 26 '19 15:11 baywet

@baywet Thanks for taking time to file this issue.

update-user -userId $Id -MailboxSettings @{"timeZone"="Eastern Standard Time"} attempts to update a users mailboxSettings property via a patch to https://graph.microsoft.com/beta/users/{id} which results in the error above.

Unfortunately, we currently don't generate cmdlets to get or set a user's mailboxSettings. This is because the Graph OData metadata represents a mailboxSettings as a property of a user's entity and not a navigation property. This ends up being ignored by our generation pipeline since it only generates cmdlets based on an entity's navigation properties.

@darrelmiller, is this something that we can fix from Graph slice service? Maybe we can transform the OData metadata.

peombwa avatar Nov 27 '19 00:11 peombwa

@peombwa thanks for the quick answers (both this one and the other one) !

baywet avatar Nov 27 '19 00:11 baywet

@peombwa Currently there isn't an easy way to do that. However, we are working on a solution for OpenAPI called Overlays that would allow you to merge a separate document into an OpenAPI document. That might solve that problem.

The other possibility, and this is a bit of a workaround, but when we merge the permissions into the CSDL we will get the scope that is used to provide access to updating that property. Maybe we can use that to generate the new operations.

darrelmiller avatar Nov 29 '19 20:11 darrelmiller

I'm looking for this functionality as well. Invoke-GraphRequest works in the meantime, but ultimately I want to be able to get this via a cmdlet

KirkMunro avatar Sep 30 '20 15:09 KirkMunro