By default it is not possible to get this list in Jira using JQL. But you can write a groovy script using https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner.
I hope this will help you!
Here is a Jira cloud addon developed by my company that allows you to search, filter and bulk delete users:
In addition, it allows you to search for inactive users (users who haven't login in a while) and perform some bulk operation.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events