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

Bab bab 6 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 Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,355 questions
Microsoft Intune
Microsoft Intune
A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.
4,306 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Crystal-MSFT 42,631 Reputation points Microsoft Vendor
    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.