" class="nav-category">Software & Hardware
This widget could not be displayed.
  • Security & Networks
  • Best Practices
  • Repo
  • This widget could not be displayed.
  • MSPs
  • This widget could not be displayed.
  • Community News
  • cancel
    Showing results for 
    Search instead for 
    Did you mean: 
    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.

    Bulk Delete Devices from a CSV

    saifshaik
    JumpCloud Employee
    JumpCloud Employee

    Hello Admins,

    In this guide, we'll explore how to effectively bulk delete JumpCloud devices from the admin console using a CSV file and JumpCloud PowerShell Module, streamlining your workflow and keeping your systems organized.

    Why?

    Efficiency is key in any operation, especially when it comes to managing devices in your system and at times, the ability to quickly and efficiently delete multiple devices at once can save you valuable time and resources. Whether you're tidying up your admin console or preparing your organization for compliance auditing, these scripts can prove invaluable for bulk deletion of devices.

    NOTE - Deletion of devices from the console will uninstall the JumpCloud Agent from any active Systems and permanently remove all System data and associations. This action CANNOT be undone.

    In the case of macOS and Windows, where FileVault and BitLocker encryption are turned on respectively, and the recovery key has been set, it's advised to back up the recovery keys for the devices being deleted, to avoid device lockout later.

    How?

    First prepare a CSV file with the 'SystemID' field (case sensitive), add the systemIDs of the devices you wish to permanently delete from your admin console and save the file.

    Next, open Powershell and Install the JumpCloud PowerShell Module (incase you do not have it already installed) or update the module (in case you get prompted of an available update) and connect to your JumpCloud instance using 'Connect-JCOnline' cmdlet and your API key from the admin console.

    Navigate to the path where the CSV is stored and run the below cmdlet to delete the systems listed in the CSV file with approval prompts for each deletion:

     

     

    Import-CSV ./FILENAME.csv | % {Remove-JCSystem -SystemID $_.SystemID}

     

     

    Screenshot 2024-02-04 at 8.58.02 AM.png

    The output of the result is as displayed in the above screenshot, which shows hostname, systemID and deletion status of the devices.

    In case, if you wish the script to automatically remove the systems without a prompt for every system, run this cmdlet instead:

     

     

    Import-CSV ./FILENAME.csv | % {Remove-JCSystem -SystemID $_.SystemID -Force}

     

     

    Screenshot 2024-02-04 at 9.00.20 AM.png

    The output of the result is as displayed in the above screenshot, where admins would not be prompted to approve each deletion.

    This concludes bulk deletion of devices using a CSV file and JumpCloud Powershell Module.

     
    Additional Options:

    To bulk delete all JumpCloud devices that have not contacted JumpCloud in the last 'X' days, you can utilize the following cmdlet, modifying the value of 'X' to the desired number of days (for example, 30, 60, 90, 120, etc.) :

     

     

    Get-JCSystem -filterDateProperty lastContact -dateFilter before -date (Get-Date).AddDays(-X) | Remove-JCSystem

     

     

    Hope this was helpful! Until next time 😄

    2 REPLIES 2

    AndriankaF
    Novitiate I

    Hi Saifshaik,

    This script was very helpful!

    anyway, can we bypass the approval prompts during remove the devices that has been inactived for more than 30 days?

    Glad the script was helpful @AndriankaF. Here's the command to achieve your requirement -

     

    Get-JCSystem -filterDateProperty lastContact -dateFilter before -date (Get-Date).AddDays(-30) | Remove-JCSystem -Force

     

     Hope this helps!