microsoftgraph / msgraph-sdk-powershell

Powershell SDK for Microsoft Graph
https://www.powershellgallery.com/packages/Microsoft.Graph
Other
696 stars 168 forks source link

Update-MgDeviceManagementWindowAutopilotDeviceIdentity seems to be not working #892

Closed hstrang closed 2 years ago

hstrang commented 3 years ago

Attempts to update autopilot device parameters with Update-MgDeviceManagementWindowAutopilotDeviceIdentity end up with the error message below. The message refers to http verb PATCH while according to the related Graph API documentation it should be a POST request instead. (POST /deviceManagement/windowsAutopilotDeviceIdentities/{windowsAutopilotDeviceIdentityId}/updateDeviceProperties)

This can be verified with Graph Explorer where POST does what is expected and PATCH gives the same error message.

_Update-MgDeviceManagementWindowAutopilotDeviceIdentity : No OData route exists that match template ~/singleton/navigation/key with http verb PATCH for request /DeviceEnrollmentFE2109/StatelessDeviceEnrollmentFEService /deviceManagement/windowsAutopilotDeviceIdentities('deviceid').

peombwa commented 3 years ago

According to the API reference, update via PATCH is not supported on this resource, and we shouldn't generate the command. We will suppress the command in the next releases.

You can use Update-MgDeviceManagementWindowAutopilotDeviceIdentityDeviceProperty to update properties of an autopilot device. The commands calls this endpoint -> https://docs.microsoft.com/en-us/graph/api/intune-enrollment-windowsautopilotdeviceidentity-updatedeviceproperties?view=graph-rest-1.0.

Find-MgGraphCommand -Uri "/deviceManagement/windowsAutopilotDeviceIdentities/{windowsAutopilotDeviceIdentityId}/updateDeviceProperties"