Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Tethered Management of iOS Devices

Jamf
October 24, 2018

Tethered Management of iOS Devices

Presentation from JNUC 2018, the world's largest rally of Apple IT administrators.

Session:
Tethered Management of iOS Devices

Presented by:
Sal Soghoian, macosxautomation.com

View all session slides, recordings and more at https://www.jamf.com/events/jamf-nation-user-conference/2018/.

Jamf

October 24, 2018
Tweet

More Decks by Jamf

Other Decks in Technology

Transcript

  1. © JAMF Software, LLC Tethered Management of iOS Devices Agenda:

    Create an automated device refresh station macOS computer Tethered iOS devices Minimal user-interaction Easy setup (no code)
  2. Backup Specified Devices Choose Connected Devices Copy Documents to Devices

    Erase Devices Get Connected Devices Install Apps on Devices Install Profiles on Devices Install Wallpaper on Devices New Properties Table for Devices Prepare Devices Prepare Devices using Automated Enrollment Rename Devices Restore Devices Restore Devices from Backups Restore Devices from Specified Backups
  3. Content Caching Shared content Software updates Apps iBooks Store &

    iTunes U Sharing Preferences > Content Caching Options…
  4. Content Caching Shared content Software updates Apps iBooks Store &

    iTunes U Cache settings Location · Size · Reset Sharing Preferences > Content Caching
  5. Commands: activate add-tags backup clear-passcode erase | erase-content exec get

    | get-property get-unlock-token help | usage install-app install-doc | install-document install-profile list | list-devices pair prepare | set-cloud-config remove-app remove-tags rename | set-name restore | update restore-backup revive syslog unpair wallpaper
  6. End Attachment Workflow Wait for Activation Prepare Devices Erase Devices

    Begin Attachment Workflow Install Profiles on Devices
  7. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

    <plist version="1.0"> <dict> <key>KeepAlive</key> <true/> <key>Label</key> <string>com.NyhthawkProductions.attachAgent</string> <key>ProgramArguments</key> <array> <string>/usr/local/bin/cfgutil</string> <string>exec</string> <string>-a</string> <string>'/Users/otto/Library/Workflows/auto-attachment.command'</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist> Launch Agent
  8. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

    <plist version="1.0"> <dict> <key>KeepAlive</key> <true/> <key>Label</key> <string>com.NyhthawkProductions.attachAgent</string> <key>ProgramArguments</key> <array> <string>/usr/local/bin/cfgutil</string> <string>exec</string> <string>-a</string> <string>'/Users/otto/Library/Workflows/auto-attachment.command'</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist> Launch Agent
  9. Launch Agent #!/bin/bash launchctl load -wF /Users/otto/Library/LaunchAgents/auto-attachment-agent.plist #!/bin/bash launchctl unload

    -wF /Users/otto/Library/LaunchAgents/auto-attachment-agent.plist Home Library Scripts .SH .SH
  10. #!/bin/bash # set attachPID to Process ID of THIS thread

    export attachPID=$$ # Indicate the path to the Automator workflow file workflowPath=$(echo ~/Library/Workflows/attachment-workflow.workflow) # Execute Automator workflow passing in string containing environment variables automator -i "ECID=$ECID&attachPID=$attachPID&PATH=$PATH&UDID=$UDID&deviceName=$deviceName
 &deviceType=$deviceType&buildVersion=$buildVersion&firmwareVersion=$firmwareVersion&locationID=$locationID" "${workflowPath}" # Check if Cache File exists if [ ! -f ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist ]; then echo "Cache file not found - Automator Workflow completed successfully" else # Cache file found - Need to check if the PID matches echo "Cache File Found - Test PID" # Get the PID from the file filePID=$(defaults read ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist attachPID) if test $attachPID -eq $filePID then # The file was created by this PID so the Workflow Failed - Clean up echo "PID Match - Workflow has failed - Clean up" rm ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist else # Re-Entry - Do Nothing echo "Re-Entry - Do Nothing" fi fi Command File
  11. #!/bin/bash # set attachPID to Process ID of THIS thread

    export attachPID=$$ # Indicate the path to the Automator workflow file workflowPath=$(echo ~/Library/Workflows/attachment-workflow.workflow) # Execute Automator workflow passing in string containing environment variables automator -i "ECID=$ECID&attachPID=$attachPID&PATH=$PATH&UDID=$UDID&deviceName=$deviceName
 &deviceType=$deviceType&buildVersion=$buildVersion&firmwareVersion=$firmwareVersion&locationID=$locationID" "${workflowPath}" # Check if Cache File exists if [ ! -f ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist ]; then echo "Cache file not found - Automator Workflow completed successfully" else # Cache file found - Need to check if the PID matches echo "Cache File Found - Test PID" # Get the PID from the file filePID=$(defaults read ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist attachPID) if test $attachPID -eq $filePID then # The file was created by this PID so the Workflow Failed - Clean up echo "PID Match - Workflow has failed - Clean up" rm ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist else # Re-Entry - Do Nothing echo "Re-Entry - Do Nothing" fi fi Command File
  12. #!/bin/bash # set attachPID to Process ID of THIS thread

    export attachPID=$$ # Indicate the path to the Automator workflow file workflowPath=$(echo ~/Library/Workflows/attachment-workflow.workflow) # Execute Automator workflow passing in string containing environment variables automator -i "ECID=$ECID&attachPID=$attachPID&PATH=$PATH&UDID=$UDID&deviceName=$deviceName
 &deviceType=$deviceType&buildVersion=$buildVersion&firmwareVersion=$firmwareVersion&locationID=$locationID" "${workflowPath}" # Check if Cache File exists if [ ! -f ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist ]; then echo "Cache file not found - Automator Workflow completed successfully" else # Cache file found - Need to check if the PID matches echo "Cache File Found - Test PID" # Get the PID from the file filePID=$(defaults read ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist attachPID) if test $attachPID -eq $filePID then # The file was created by this PID so the Workflow Failed - Clean up echo "PID Match - Workflow has failed - Clean up" rm ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist else # Re-Entry - Do Nothing echo "Re-Entry - Do Nothing" fi fi Command File
  13. #!/bin/bash # set attachPID to Process ID of THIS thread

    export attachPID=$$ # Indicate the path to the Automator workflow file workflowPath=$(echo ~/Library/Workflows/attachment-workflow.workflow) # Execute Automator workflow passing in string containing environment variables automator -i "ECID=$ECID&attachPID=$attachPID&PATH=$PATH&UDID=$UDID&deviceName=$deviceName
 &deviceType=$deviceType&buildVersion=$buildVersion&firmwareVersion=$firmwareVersion&locationID=$locationID" "${workflowPath}" # Check if Cache File exists if [ ! -f ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist ]; then echo "Cache file not found - Automator Workflow completed successfully" else # Cache file found - Need to check if the PID matches echo "Cache File Found - Test PID" # Get the PID from the file filePID=$(defaults read ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist attachPID) if test $attachPID -eq $filePID then # The file was created by this PID so the Workflow Failed - Clean up echo "PID Match - Workflow has failed - Clean up" rm ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist else # Re-Entry - Do Nothing echo "Re-Entry - Do Nothing" fi fi Command File
  14. #!/bin/bash # set attachPID to Process ID of THIS thread

    export attachPID=$$ # Indicate the path to the Automator workflow file workflowPath=$(echo ~/Library/Workflows/attachment-workflow.workflow) # Execute Automator workflow passing in string containing environment variables automator -i "ECID=$ECID&attachPID=$attachPID&PATH=$PATH&UDID=$UDID&deviceName=$deviceName
 &deviceType=$deviceType&buildVersion=$buildVersion&firmwareVersion=$firmwareVersion&locationID=$locationID" "${workflowPath}" # Check if Cache File exists if [ ! -f ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist ]; then echo "Cache file not found - Automator Workflow completed successfully" else # Cache file found - Need to check if the PID matches echo "Cache File Found - Test PID" # Get the PID from the file filePID=$(defaults read ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist attachPID) if test $attachPID -eq $filePID then # The file was created by this PID so the Workflow Failed - Clean up echo "PID Match - Workflow has failed - Clean up" rm ~/Library/Caches/com.apple.configurator.AttachedDevices/$ECID.plist else # Re-Entry - Do Nothing echo "Re-Entry - Do Nothing" fi fi Command File
  15. Apple Provisioning Utility Batch process up to 40 iOS devices

    Dynamic dashboard interface Minimal setup (Automator workflow)
  16. configautomation.com Toolkit: actions · workflow · command · agent MDM

    Jamf | Now Flexible design automated enrollment Tethered Management of iOS Devices
  17. © JAMF Software, LLC Thank you for listening! Give us

    feedback by completing the 2-question session survey in the JNUC 2018 app. UP NEXT Providing the Best Mac Experience Possible, From the Mac CoE Team with — 1:30 PM - 2:15 PM