How to setup lost mode in the Intune portal for the device using Graph API by Powershall script

Bab bab 11 Reputation points
2021-03-24T21:27:59.907+00:00

Any option to enable lost mode in the Intune portal for the device using Graph API by Powershall script

Windows for business | Windows Server | User experience | PowerShell
Microsoft Security | Intune | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Crystal-MSFT 54,206 Reputation points Microsoft External Staff
    2021-03-25T09:03:04.44+00:00

    @Bab bab , This is from Intune support. For your request, maybe you can try the following scripts:

    import-Module Microsoft.Graph.Intune #import intune module  
      
    Update-MSGraphEnvironment -SchemaVersion beta #set schema version as beta  
    Connect-MSGraph  #connect to MS grasp  
      
    $body = @{'message' = 'Please Contact me';  
              'phoneNumber' = '1111111111';  
          'footer'= 'Test'}  
    $bodyobj = New-Object -TypeName PSObject -Property $body  
    Invoke-MSGraphRequest -Url /deviceManagement/managedDevices/5cb***b603ea/enableLostMode -Content $bodyobj -HttpMethod POST  
    

    Note: Please change the related infromation as your reference.

    Here is a link related with lost mode in Graph API for the referrence:
    https://learn.microsoft.com/en-us/graph/api/intune-devices-manageddevice-enablelostmode?view=graph-rest-beta

    Hope it can help.


    If the response is helpful, please click "Accept Answer" and upvote it.
    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.