Discussion Series: Tableau Server Automation
With each new version of Tableau, newer features are also added to the server too, and in recent years, many of these features have tended to lean towards automation, and user notifications.
However, despite the changes, one of the most useful features Tableau provide, comes in the form of the telnet-like client interface: Tabcmd.
Unlike the built-in features, Tabcmd is an older tool implemented in some of the earliest versions of the server, which, also unlike the main features, offers substantially more powerful functions that with the correct automation setup, can provide a much more powerful set of functions.
What is Tabcmd, Where Can I Get It, and How Do I Use It?
1. Tabcmd is a command-line tool
That provides a tel-net like interface to Tableau Server, allowing developers and administrators even greater flexibility over the control of Tableau Server, from:
- User and user-group admin
- Domain and site admin
- Workbook control such as
- Refresh Execution
- Extract deletion
- Workbook and/or specific page render to image (png) or pdf
2. Where can I get Tabcmd
The latest version of Tabcmd can be downloaded direct from Tableau: simply head on over to the server releases page: https://www.tableau.com/support/releases/server
And either expand the latest server release or, find your server release and expand
Tabcmd is backwards compatible so the latest version will continue to work with your server version
Scroll to download section of the chosen release page (always at the bottom), and download the Tabcmd installer:
And finally, install to the server that shall be running your automation - this does not need to be the same server that Tableau Server has been installed to; I would also recommend that you either install to the root folder of your server or, follow these final steps:
After Default Install
As Tabcmd does not write any registry keys, once it has been installed (deployed) to your server, you can simply move the working directory to your system-root or, a safe working environment - I shall assume this to be C:\ for the rest of these steps:
- In the root (C:\) create a new folder "tabcmd"
- Enter your new tabcmd directory and add a new directory "scripts" - you can name this to anything you like, I just prefer scripts; this will become the working directory for your automation files
- Navigate to the Tabcmd install directory, if you used the defaults, this will be something like: C:\Program Files\Tableau\Tableau Server\<Your Version>\extras\
- Cut or Copy the two folders ("Command Line Utility" and "repository") from the extras directory to your "tabcmd" directory in your root
- Navigate back to your tabcmd directory: C:\tabcmd
- Rename the "Command line Utility" directory to "tabcmd" - this is for programming ease
And now to test the correct installation of Tabcmd, this will likely fail, don't worry, we are simply testing that Tabcmd will initialise properly:
- Open a new command line instance and navigate to C:\tabcmd\tabcmd
- Enter this string: tabcmd login -s http://localhost -u me -p me
- Tabcmd should initialise the login before throwing an error (as unless you are running Tableau Server on your local machine, Tabcmd will be unable to connect to the server instance)
You can now remove the C:\Program Files\Tableau\Tableau Server directory from your machine - if you are not running Tableau Server from this directory
You can now re-deploy Tabcmd to any machine inside (or even outside) your network simply by copying your C:\tabcmd folder. Tabcmd is a self-contained utility, the only registry keys that are written during installation are only to aid the uninstaller, and are not required for the program.
3. How Do I Use Tabcmd
See the following pages for guidance, particularly the Tabcmd commands (https://help.tableau.com/current/server/en-us/tabcmd_cmd.htm) I have also provided this list on the Tabcmd Commands (below) in case the Tabcmd's list be moved or removed from Tableau.
The basic usage is to ensure you are working from the tabcmd directory (C:\tabcmd\tabcmd if you followed my guidance above), and to begin each command with "tabcmd":
Example 1: Logging into the server | Example 2: Print to png |
---|---|
The guidance provided on the following pages have been written for, and assume that your workbooks are connected to a database, although, the methods here can also be used with flat-files too.