Skip to content

Instantly share code, notes, and snippets.

@saiyam1814
Created January 15, 2018 16:18
Show Gist options
  • Save saiyam1814/8954ce9e096ec12d65248f7e454d8d8b to your computer and use it in GitHub Desktop.
Save saiyam1814/8954ce9e096ec12d65248f7e454d8d8b to your computer and use it in GitHub Desktop.
Inactive user list in DTR Raw
#!/usr/bin/env bash
#Below will create a inactive.txt file with names of inactive users.
#change the username and password to proper one
#replace {DTRURL} with actual DTR URL
curl -u "$1":"$2" https://{DTRURL}/enzi/v0/accounts?limit=1000000 | jq '.accounts[] | select(.isActive == false)'| jq '.name' > inactive.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment