How to export users?

How to export users?

We are working to set up some new features in our environment and have come to the realization that our list of users is extremely bloated. 
Before going in and deleting all the invalid accounts, we would like to be able to get an export of the current list.

The interface does not natively have a method to export the data, and reports all seem to be focused on tickets and assets. I found this thread from five years ago, but the query does not work. Export and Import a list of users. (manageengine.com)

Through some experimentation, this seems to pull a simple list of the account names, but I have not managed to get any further info. 
SELECT "aau"."FIRST_NAME" AS "Requester"
FROM "SDUser" "sdu" LEFT JOIN "AaaUser" "aau" ON "sdu"."USERID"="aau"."USER_ID" 

We would like to have Name, Type, CI Type, Login Name, Primary Email, Department Name, Site, Phone, Mobile, Job title as it is when viewing the users under Users & Permission.

                  New to ADSelfService Plus?