{"id":101531,"date":"2023-11-27T03:49:00","date_gmt":"2023-11-27T08:49:00","guid":{"rendered":"https:\/\/jumpcloud.com\/?post_type=support&p=101531"},"modified":"2024-01-11T13:14:46","modified_gmt":"2024-01-11T18:14:46","slug":"remove-inactive-devices-via-powershell","status":"publish","type":"support","link":"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell","title":{"rendered":"Remove Inactive Devices via PowerShell"},"content":{"rendered":"\n

If your organization has a high number of inactive devices in JumpCloud, you can use the JumpCloud PowerShell Module to execute a clean up script and remove all inactive devices.<\/p>\n\n\n\n

<\/p><\/div>

Important:<\/strong> \n

The following steps require the JumpCloud PowerShell Module installed on your device. To download and install the JumpCloud PowerShell Module, see Install the JumpCloud PowerShell Module<\/a>.<\/p>\n <\/div><\/div><\/div><\/div>\n\n\n\n

Connecting to Your Organization via PowerShell<\/h2>\n\n\n\n

Before running any commands, you’ll first need to connect to the JumpCloud PowerShell Module. <\/p>\n\n\n\n

    \n
  1. Open Windows PowerShell<\/strong> on your device and execute the following command: Connect-JCOnline<\/code><\/li>\n\n\n\n
  2. Enter the API key of your JumpCloud account. To gather your API key, see Accessing Your API Key<\/a>.<\/li>\n\n\n\n
  3. Once you enter the API key, the JumpCloud modules will be imported to the system. Your JCOrgID<\/strong> and JCOrgName<\/strong> are shown after successful import.<\/li>\n\n\n\n
  4. Execute the following command to list all the devices in your JumpCloud org: Get-JCSystem<\/code><\/li>\n<\/ol>\n\n\n\n

    Removing Inactive Devices from Your Organization<\/h2>\n\n\n\n

    <\/p><\/div>

    Warning:<\/strong> \n

    This command will permanently remove the devices that fall within the criteria. There is no recovery or undo script. Proceed with caution.<\/p>\n <\/div><\/div><\/div><\/div>\n\n\n\n

      \n
    1. The following command will permanently<\/strong> remove all the devices that have a lastContact date greater than 60 days.<\/li>\n<\/ol>\n\n\n\n
      \n

      Get-JCSystem | Where-Object lastContact -lT (Get-Date).AddDays(-60).ToString(‘yyy-MM-ddTHH:MM:ss’) | Remove-JCSystem<\/p>\n<\/div><\/div>\n\n\n\n

      <\/p><\/div>

      Important:<\/strong> \n

      You can modify the number of days since last contact according to your requirements (for example 30, 60, 90, 120, etc). To do so, modify the value within the AddDays(-XX<\/strong>) field.<\/p>\n <\/div><\/div><\/div><\/div>\n\n\n\n

        \n
      1. PowerShell prompts for confirmation to remove the selected devices. Select Y<\/strong> (yes) to remove the devices.
        After the successful execution of the command, a list of removed devices is displayed.<\/li>\n\n\n\n
      2. You can verify the removed devices are no longer visible in the Devices list within your JumpCloud Organization via the Admin Portal.\n
          \n
        1. Log into your JumpCloud Admin Portal<\/a>.<\/li>\n\n\n\n
        2. Go to DEVICE MANAGEMENT<\/strong> > Devices<\/strong> and click the Devices<\/strong> tab.<\/li>\n\n\n\n
        3. Cross-reference the Devices list with the output of removed devices from the PowerShell command. <\/li>\n<\/ol>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"

          If your organization has a high number of inactive devices in JumpCloud, you can use the JumpCloud PowerShell Module to […]<\/p>\n","protected":false},"author":223,"featured_media":0,"template":"","meta":{"_acf_changed":false,"_oasis_is_in_workflow":0,"_oasis_original":0,"_oasis_task_priority":"2normal","inline_featured_image":false,"footnotes":""},"support_category":[2856,3136,2916,3127],"support_tag":[3160],"coauthors":[3144],"acf":[],"yoast_head":"\nRemove Inactive Devices via PowerShell - JumpCloud<\/title>\n<meta name=\"description\" content=\"Learn how to use the JumpCloud PowerShell Module to connect and remove inactive devices within your organization.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Remove Inactive Devices via PowerShell\" \/>\n<meta property=\"og:description\" content=\"Learn how to use the JumpCloud PowerShell Module to connect and remove inactive devices within your organization.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell\" \/>\n<meta property=\"og:site_name\" content=\"JumpCloud\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-11T18:14:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jumpcloud.com\/wp-content\/uploads\/2024\/07\/202405-MISC-JumpCloudHelpCenter-SiteDisplay-min-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"890\" \/>\n\t<meta property=\"og:image:height\" content=\"525\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data2\" content=\"sweta.soumya@jumpcloud.com\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell\",\"url\":\"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell\",\"name\":\"Remove Inactive Devices via PowerShell - JumpCloud\",\"isPartOf\":{\"@id\":\"https:\/\/jumpcloud.com\/#website\"},\"datePublished\":\"2023-11-27T08:49:00+00:00\",\"dateModified\":\"2024-01-11T18:14:46+00:00\",\"description\":\"Learn how to use the JumpCloud PowerShell Module to connect and remove inactive devices within your organization.\",\"breadcrumb\":{\"@id\":\"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/jumpcloud.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Support\",\"item\":\"https:\/\/jumpcloud.com\/support\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Remove Inactive Devices via PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/jumpcloud.com\/#website\",\"url\":\"https:\/\/jumpcloud.com\/\",\"name\":\"JumpCloud\",\"description\":\"Daily insights on directory services, IAM, LDAP, identity security, SSO, system management (Mac, Windows, Linux), networking, and the cloud.\",\"publisher\":{\"@id\":\"https:\/\/jumpcloud.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/jumpcloud.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/jumpcloud.com\/#organization\",\"name\":\"JumpCloud\",\"url\":\"https:\/\/jumpcloud.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/jumpcloud.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jumpcloud.com\/wp-content\/uploads\/2021\/01\/jc-logo-brand-2021.png\",\"contentUrl\":\"https:\/\/jumpcloud.com\/wp-content\/uploads\/2021\/01\/jc-logo-brand-2021.png\",\"width\":598,\"height\":101,\"caption\":\"JumpCloud\"},\"image\":{\"@id\":\"https:\/\/jumpcloud.com\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Remove Inactive Devices via PowerShell - JumpCloud","description":"Learn how to use the JumpCloud PowerShell Module to connect and remove inactive devices within your organization.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell","og_locale":"en_US","og_type":"article","og_title":"Remove Inactive Devices via PowerShell","og_description":"Learn how to use the JumpCloud PowerShell Module to connect and remove inactive devices within your organization.","og_url":"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell","og_site_name":"JumpCloud","article_modified_time":"2024-01-11T18:14:46+00:00","og_image":[{"width":890,"height":525,"url":"https:\/\/jumpcloud.com\/wp-content\/uploads\/2024\/07\/202405-MISC-JumpCloudHelpCenter-SiteDisplay-min-2.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes","Written by":"sweta.soumya@jumpcloud.com"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell","url":"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell","name":"Remove Inactive Devices via PowerShell - JumpCloud","isPartOf":{"@id":"https:\/\/jumpcloud.com\/#website"},"datePublished":"2023-11-27T08:49:00+00:00","dateModified":"2024-01-11T18:14:46+00:00","description":"Learn how to use the JumpCloud PowerShell Module to connect and remove inactive devices within your organization.","breadcrumb":{"@id":"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/jumpcloud.com\/support\/remove-inactive-devices-via-powershell#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/jumpcloud.com\/"},{"@type":"ListItem","position":2,"name":"Support","item":"https:\/\/jumpcloud.com\/support"},{"@type":"ListItem","position":3,"name":"Remove Inactive Devices via PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/jumpcloud.com\/#website","url":"https:\/\/jumpcloud.com\/","name":"JumpCloud","description":"Daily insights on directory services, IAM, LDAP, identity security, SSO, system management (Mac, Windows, Linux), networking, and the cloud.","publisher":{"@id":"https:\/\/jumpcloud.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jumpcloud.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/jumpcloud.com\/#organization","name":"JumpCloud","url":"https:\/\/jumpcloud.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jumpcloud.com\/#\/schema\/logo\/image\/","url":"https:\/\/jumpcloud.com\/wp-content\/uploads\/2021\/01\/jc-logo-brand-2021.png","contentUrl":"https:\/\/jumpcloud.com\/wp-content\/uploads\/2021\/01\/jc-logo-brand-2021.png","width":598,"height":101,"caption":"JumpCloud"},"image":{"@id":"https:\/\/jumpcloud.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/jumpcloud.com\/wp-json\/wp\/v2\/support\/101531"}],"collection":[{"href":"https:\/\/jumpcloud.com\/wp-json\/wp\/v2\/support"}],"about":[{"href":"https:\/\/jumpcloud.com\/wp-json\/wp\/v2\/types\/support"}],"author":[{"embeddable":true,"href":"https:\/\/jumpcloud.com\/wp-json\/wp\/v2\/users\/223"}],"version-history":[{"count":2,"href":"https:\/\/jumpcloud.com\/wp-json\/wp\/v2\/support\/101531\/revisions"}],"predecessor-version":[{"id":103124,"href":"https:\/\/jumpcloud.com\/wp-json\/wp\/v2\/support\/101531\/revisions\/103124"}],"wp:attachment":[{"href":"https:\/\/jumpcloud.com\/wp-json\/wp\/v2\/media?parent=101531"}],"wp:term":[{"taxonomy":"support_category","embeddable":true,"href":"https:\/\/jumpcloud.com\/wp-json\/wp\/v2\/support_category?post=101531"},{"taxonomy":"support_tag","embeddable":true,"href":"https:\/\/jumpcloud.com\/wp-json\/wp\/v2\/support_tag?post=101531"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/jumpcloud.com\/wp-json\/wp\/v2\/coauthors?post=101531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}