Disclaimer
JUMPCLOUD EXPRESSLY DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS, AND LIABILITIES OF ANY KIND ARISING FROM OR RELATED TO THIRD-PARTY SOFTWARE, SCRIPTS, REPOSITORIES, AND APIS. JUMPCLOUD IS NOT REQUIRED TO SUPPORT ANY SUCH THIRD-PARTY MATERIALS AND ALL RISKS RELATED TO THIRD-PARTY MATERIALS ARE YOUR RESPONSIBILITY. PLEASE ALSO REVIEW THE JUMPCLOUD TOS.
A Powershell Script to Bulk Erase Devices - Mac
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
โ08-31-2023 08:02 AM
Reposting a script from @hoium which answered the question of how to bulk erase devices via scripts/commands: Thank you @hoium for your continued contribution to the JumpCloud script repo!
#!/usr/bin/env pwsh
โ
# Script used to Wipe Apple MDM Devices in Bulk
โ
# JumpCloud API-Key - DO NOT COMMIT JC API-KEY
$ApiKey = Read-Host -Prompt 'Input your JumpCloudApiKey'
$jcApiKey = $ApiKey
โ
# Apple MDM ID
$AppleMDMID = ''
โ
# Set 6 Digit Lock Code
$PinCode = ''
โ
# List Mac's MDM Device IDs - NOT JumpCloud Device ID
# Located on the Device Details Page
$devices = @(
# '$DEVICE_MDM_ID'
)
โ
# Connect to JumpCloud Module
Connect-JCOnline -JumpCloudApiKey $jcApiKey
โ
# Wipe Apple Devices
try {
foreach ($device in $devices) {
Write-Host "`nSending Apple MDM Wipe Device Command to" $device -ForegroundColor Green
Clear-JcSdkAppleMdmDevice -AppleMdmId $AppleMDMID -DeviceId $device -Pin $PinCode
}
}
catch {
Write-Error "Something went wrong Wiping Device! $($_.Exception.Message)" -ErrorAction Stop
}
Labels:
- Labels:
-
PowerShell
0 REPLIES 0

