Skip to content

Instantly share code, notes, and snippets.

@gkweb
Last active December 16, 2020 00:22
Show Gist options
  • Save gkweb/b2176aa523cb79ee5b87aa25e0634d70 to your computer and use it in GitHub Desktop.
Save gkweb/b2176aa523cb79ee5b87aa25e0634d70 to your computer and use it in GitHub Desktop.
Bulk/Batch delete auth0 users
// WARNING USE WITH CAUTION! This will delete any user in the search result!!! - You have been warned!
// Quicker than setting up the Management API with all its related tooling
// Step 1 - Search for the users you want to delete in /dashboard/COUNTRYCODE/TENANT/users
// Step 2 - Open the browser console and paste the following. Be sure to read the warning at the top of the file.
Array.prototype.slice.call(document.querySelectorAll('table[data-cosmos-key=table] > tbody > tr')).forEach(e => {
setTimeout(() => {
console.log('Deleting...')
e.querySelector('td:last-child button').click()
e.querySelector('td:last-child ul li:last-child').click()
document.querySelector('[data-cosmos-key="dialog.footer"] span:first-child button').click()
}, 1000)
})
// Step 3 - You may need to repeat Step 2 again - If there are multiple pages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment