MS Graph EnableLostMode isn't working - How to enable lost mode in Powershell

FreddyD 1 Reputation point
2024-10-02T13:12:04.04+00:00

User's image

I found the documentation [1], [2] and tried it in Graph Explorer [3] and got "Bad Request" [4].

How to enable lost mode in Powershell?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,001 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
5,053 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Xenia-MSFT 2,255 Reputation points Microsoft Vendor
    2024-10-03T02:20:38.9333333+00:00

    @FreddyD Thanks for posting in our Q&A.

    For this issue, please check if you choose one of the permissions in the following link:

    https://video2.skills-academy.com/en-us/graph/api/intune-devices-manageddevice-enablelostmode?view=graph-rest-beta#permissions

    Because I didn't have an iOS device (supervised only), I can't repeat this test. However, I can share you the steps to get the correct request.

    1.Enter "F12" to open the DevTools.

    2.Click on the "Lost mode" in intune portal and we can see many requests under Network in DevTools.

    User's image

    3.Find the target graph api name and the Request Method shows "post" in DevTools. Then we will get the correct Request URL.

    User's image

    4.Click on Payload > View Source and we will see the correct request body.

    User's image

    5.Cope the Request URL in step3 and the Request Body in step4 in Graph and check if it works.

    Hope it will give you some ideas.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.