--- title: "Bulk Delete Registered Devices for Shared Users" slug: "bulk-delete-registered-devices-for-shared-users" updated: 2025-11-26T15:51:25Z published: 2025-11-26T15:51:25Z canonical: "support.appgate.com/bulk-delete-registered-devices-for-shared-users" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.appgate.com/llms.txt > Use this file to discover all available pages before exploring further. # Bulk Delete Registered Devices for Shared Users For shared users used in troubleshooting, capping the number of allowed devices This snippet will help you delete all registered devices and clear the shared user to register on a new device. Go to JavaScript debug console [https://controllerFQDN:AdminPORT/ui/console/index.html](https://controllerFQDN:AdminPORT/ui/console/index.html) Paste the code in the script source pane. Adjust the userName in the first let command ```javascript // Delete Registered Devices /* MIT License Copyright (c) 2023 AppGate Cybersecurity, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ let userName = "john.smith" //Add user name, you can find it in column Username under page Home->Usage->Registered Devices const fetchOptions = { headers: getHeaders() }; const dns =  await fetch("/admin/on-boarded-devices", fetchOptions).then(response => response.json()).then(json => json.data.filter(item => item.distinguishedName.includes(userName)).map(device => device.distinguishedName)) console.log(dns); //Print's all the regitered devices for (dn of dns){  let globalHeaders = (getHeaders())  let authorizationtest= globalHeaders["authorization"]  let myHeaders = new Headers();  myHeaders.append("Content-Type", "application/json");  myHeaders.append("Accept", "application/vnd.appgate.peer-v16+json");  myHeaders.append("Authorization", authorizationtest)  var requestOptions = {    method: 'DELETE',    redirect: 'follow',    headers: myHeaders  };  fetch("/admin/on-boarded-devices/"+dn, requestOptions)    .then(response => response.text())    .then(result => console.log(result))    .catch(error => console.log('error', error)); } ```