From 7a2dbf10d2b30578ba06885cde62ac17407526ce Mon Sep 17 00:00:00 2001 From: WinDino <36110475+WinDino@users.noreply.github.com> Date: Fri, 12 Jul 2024 13:00:09 +0200 Subject: [PATCH] Updated and fixed the paths (microsoft-intune) Based on the official documentation: https://learn.microsoft.com/en-us/graph/api/intune-devices-manageddevice-delete?view=graph-rest-1.0&tabs=http --- microsoft-intune/1.0.0/src/app.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/microsoft-intune/1.0.0/src/app.py b/microsoft-intune/1.0.0/src/app.py index 5b154431..3f1ac2d0 100644 --- a/microsoft-intune/1.0.0/src/app.py +++ b/microsoft-intune/1.0.0/src/app.py @@ -48,7 +48,7 @@ def authenticate(self, tenant_id, client_id, client_secret, graph_url): def list_devices(self, tenant_id, client_id, client_secret): graph_url="https://graph.microsoft.com" session = self.authenticate(tenant_id, client_id, client_secret, graph_url) - graph_url = "https://graph.microsoft.com/v1.0/devices/" + graph_url = "https://graph.microsoft.com/v1.0/devices" ret = session.get(graph_url) return ret.text @@ -76,28 +76,28 @@ def managed_device(self, tenant_id, client_id, client_secret): def get_managed_device(self, tenant_id, client_id, client_secret, managedDeviceId): graph_url="https://graph.microsoft.com" session = self.authenticate(tenant_id, client_id, client_secret, graph_url) - graph_url=f"https://graph.microsoft.com/v1.0/managedDevices/{managedDeviceId}" + graph_url=f"https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/{managedDeviceId}" ret = session.get(graph_url) return ret.text def delete_managed_device(self, tenant_id, client_id, client_secret, managedDeviceId): graph_url="https://graph.microsoft.com" session = self.authenticate(tenant_id, client_id, client_secret, graph_url) - graph_url=f"https://graph.microsoft.com/v1.0/managedDevices/{managedDeviceId}" + graph_url=f"https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/{managedDeviceId}" ret = session.delete(graph_url) return ret.text def remotelock(self, tenant_id, client_id, client_secret, managedDeviceId): graph_url="https://graph.microsoft.com" session = self.authenticate(tenant_id, client_id, client_secret, graph_url) - graph_url=f"https://graph.microsoft.com/v1.0/managedDevices/{managedDeviceId}/remoteLock" + graph_url=f"https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/{managedDeviceId}/remoteLock" ret = session.post(graph_url) return ret.text def shutdown(self, tenant_id, client_id, client_secret, managedDeviceId): graph_url="https://graph.microsoft.com" session = self.authenticate(tenant_id, client_id, client_secret, graph_url) - graph_url=f"https://graph.microsoft.com/v1.0/managedDevices/{managedDeviceId}/shutDown" + graph_url=f"https://graph.microsoft.com/v1.0/deviceManagement/managedDevices/{managedDeviceId}/shutDown" ret = session.post(graph_url) return ret.text