cancel
Showing results for 
Search instead for 
Did you mean: 

A Powershell Script to Bulk Erase Devices - Windows

urvashi
Iron I
Iron I

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 Erase Windows Devices in Bulk

# JumpCloud API-Key - DO NOT COMMIT JC API-KEY
$ApiKey = Read-Host -Prompt 'Input your JumpCloudApiKey'
$jcApiKey = $ApiKey

# List of JumpCloud Device IDs
$devices = @(
# ''
)

# Connect to JumpCloud Module
Connect-JCOnline -JumpCloudApiKey $jcApiKey

# Wipe Devices
try {
foreach ($device in $devices) {
Write-Host "`Wiping Windows PC" $device -ForegroundColor Green
Clear-JcSdkSystem -SystemId $device
}
}
catch {
Write-Error "Something went wrong Restarting PC! $($_.Exception.Message)" -ErrorAction Stop
}

 

0 REPLIES 0
You Might Like

New to the site? Take a look at these additional resources:

Community created scripts:

Our new Radical Admin blog:

Keep up with Product News:

Read our community guidelines

Ready to join us? You can register here.