export users to excel

I have used the python tsAPI to export/print our TS user accounts.

 

However, that API does not allow me access to the email field for the user accounts.

 

Is there a way to export the user data (including the email field)?

12replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • You can export the email addresses. Have a look at the user management tools on our community-tools github. If you use the provided script ts_ug_util.py with the get command it will write all the accounts to an excel file for you, e.g.

    python ts_ug_util.py --ts_url https://your_ts_url --username <admin user> --password <admin password> get

     

    Note: the community tools Github can be found on: https://github.com/thoughtspot/community-tools/

    Reply Like 1
  • Great and thank you.

     

    3 follow up questions:

    1) Is there a way to then upload those accounts back into TS?

     

    2) would we need to remove all of the accounts on the appliance, and then reupload them from scratch with THIS technique?

    3) do you know if the TS python libraries are being expanded to allow "UPDATING" user accounts?

    Reply Like
  • 1) Yes you can also upload them back. See the sync_excel command in that same script

    2 & 3) The script will update them if you just load them back. There is a separate setting in the sync where you can define whether users deleted should also be removed from TS.

    Note: that this script (ts_ug_util.py) just provides easy access to commands we commonly use in the field. The underlying API scripts provide much more flexibility and features to really customise this.

    Reply Like
  • Misha Beek Hi Misha, 

    I get an error when trying to get the users: 

    Failed to establish a new connection: [Errno 110] Connection timed out',))

    any ideas why? 

    Reply Like
  • Marc Price Hi Marc, not sure. You only get connection issues doing this? What is the command you are executing?

    Reply Like
  • Misha Beek this is the command I am running: 

    python ts_ug_util.py --ts_url https://thoughtspot_URL --username <USER> --password <PASSWORD> get

    Reply Like
  • Command looks ok to me. Just re-tried it myself and it works fine. Please note that the username and password should be the username and password for the admin at the front-end (not the back-end). But the wrong account should have given you a authentication failure. 

    Reply Like
  • Misha Beek looks like a firewall issue

    does this have to be run from the TS node that you are trying to get the list of users from? 

    Reply Like
  • No this should just be run from your client machine, not the TS instance

    Reply Like
  • I am also trying to run the python script to extract user accounts.

    But I am a TS and python newb and have no idea how or where to run this script - get_group_users.py

    I am the admin but can anyone guide me with basic instructions about how to run this script?

    Do I just copy and paste the script into Putty once logged into TS?

    I will also need to add the proper arguments for the hostname, username and password.

    Thanks

    Reply Like
  • David,

     

    1.  You don't need to be on the TS appliance and I generally recommend that you not be.  This script uses the TS web APIs so can run from any system that has network access to your cluster.
    2. General instructions for setting up a virtual Python environment and installing can be found here:  https://github.com/thoughtspot/community-tools/tree/master/python_tools.  Note that you need Python3 for the latest version of this script.
    3. Specific details for the user tools scripts, including get_users, can be found here:  https://github.com/thoughtspot/user_toolshttps://github.com/thoughtspot/user_tools

    Reply Like
  • I recommend using the pip-install method of installing the tools.  The argument are for a UI admin user, e.g. tsadmin.  The documentation hopefully explains these arguments well.

    Reply Like
Like Follow
  • Status Answered
  • 1 mth agoLast active
  • 12Replies
  • 59Views
  • 5 Following