Skip to main content
Solved

Activeted Lost mode on more iPads than one

  • September 13, 2023
  • 3 replies
  • 39 views

JamFm
Forum|alt.badge.img+8

Hi all,

Is there a solution to mark several iPads via Jamf and trigger a LostMode?

e.g. 20 or more 50 iPads are stolen from a school and you want to activate the Lostmode with the appropriate message.

How could we trigger this as quickly as possible and without much time expenditure with a message?

Without having to set the LostMode on the iPad individually?

Nice Regards

Peter

Best answer by TrixMedia

Hi JamFm,

As far as I am aware, there is no way to do this currently within Jamf School but it is a feature that the Jamf team are looking into. It was recently put into a feature request on Jamf Nation. 
I would advise you upvote this as this allows the Jamf team to see that this is a wanted feature.

https://ideas.jamf.com/ideas/JN-I-25219

Many Thanks,
Matt

3 replies

TrixMedia
Forum|alt.badge.img+3
  • New Contributor
  • Answer
  • September 13, 2023

Hi JamFm,

As far as I am aware, there is no way to do this currently within Jamf School but it is a feature that the Jamf team are looking into. It was recently put into a feature request on Jamf Nation. 
I would advise you upvote this as this allows the Jamf team to see that this is a wanted feature.

https://ideas.jamf.com/ideas/JN-I-25219

Many Thanks,
Matt


JamFm
Forum|alt.badge.img+8
  • Author
  • Contributor
  • September 13, 2023

Hi JamFm,

As far as I am aware, there is no way to do this currently within Jamf School but it is a feature that the Jamf team are looking into. It was recently put into a feature request on Jamf Nation. 
I would advise you upvote this as this allows the Jamf team to see that this is a wanted feature.

https://ideas.jamf.com/ideas/JN-I-25219

Many Thanks,
Matt


Thanks Matt 👍


Forum|alt.badge.img+11
  • Contributor
  • September 13, 2023

In the past, I have used this script to do what you describe via jamf pro, hope this helps.

 

------------

 

#!/bin/bash
 
# server connection information
URL="$JSSFQDN"
userName="$apiaccount"
password="$apipass"
 
# Lost Mode messaging
lostModeMsg="$messagehere"
lostModePhone="$phonehere"
lostModeFootnote="$footnote"
 
# path to list of serial numbers
deviceList="$serials.txt"
 
xpath() {
    # the xpath tool changes in Big Sur
    if [[ $(sw_vers -buildVersion) > "20A" ]]; then
        /usr/bin/xpath -e "$@"
    else
        /usr/bin/xpath "$@"
    fi
}
 
mobileDeviceList=$( /bin/cat "$deviceList" )
 
# send Lost Mode command to every device in mobile device list
for aDevice in ${mobileDeviceList[@]}
do
    # get Jamf Pro ID for device
    deviceID=$( /usr/bin/curl -s "$URL/JSSResource/mobiledevices/serialnumber/$aDevice" \\
    --user "$userName:$password" \\
    --header "Accept: text/xml" \\
    --request GET | \\
    xpath '/mobile_device/general/id/text()' )
 
    # API submission command
    xmlData="<mobile_device_command>
<general>
<command>EnableLostMode</command>
<lost_mode_message>$lostModeMsg</lost_mode_message>
<lost_mode_phone>$lostModePhone</lost_mode_phone>
<lost_mode_footnote>$lostModeFootnote</lost_mode_footnote>
</general>
<mobile_devices>
<mobile_device>
<id>$deviceID</id>
</mobile_device>
</mobile_devices>
</mobile_device_command>"
 
    # flattened XML
    flatXML=$( /usr/bin/xmllint --noblanks - <<< "$xmlData" )
 
    /usr/bin/curl -s "$URL/JSSResource/mobiledevicecommands/command/EnableLostMode"\\
    --user "$userName":"$password" \\
    --header "Content-Type: text/xml" \\
    --request POST \\
    --data "$flatXML"
 
    echo "Sending Enable Lost Mode Command to Device ID: $deviceID..."
done
 
exit 0