tabcmd can be used to perform and automate various admin tasks in Tableau Server without directly logging into Tableau Server.

The commands are passed through the Command Prompt window.

Some of the tasks that can be performed through tabcmd are listed below;

  1. Create or Delete Site
  2. Adding/Deleting Users and Groups
  3. Updating user permissions
  4. Publishing workbooks to Server
  5. Deleting workbooks in Server
  6. Mailing PDF
  7. Downloading PDF, CSV, PNG of a worksheet
  8. Refreshing Extracts

And many more..

tabcmd is part of Tableau Server which can be accessed from remote machines also, provided the respective machines have access to Tableau Server. You can download tabcmd from Tableau’s website and use in remote machines. tabcmd is also supported by Tableau Online.

Navigating to tabcmd

tabcmd can be found in the path below in the server machine or the machine in which you have installed tabcmd.

C:\Program Files\Tableau\Tableau Server\<Tableau Version>\extras\Command Line Utility

Automate admin tasks with tabcmd

In this blog, we will discuss some of the most commonly used tabcmd commands.*

*Navigate to the path above before proceeding to the next steps in this blog.

Logging into Tableau Server

Syntax: tabcmd login -s <Server URL/IP Address>  -t <Site Name> -u <username> -p <Password>
Automate admin tasks with tabcmd

Publishing Tableau Workbooks

Syntax: tabcmd publish <Path where Tableau Workbook is present> -r <Project Name>
Automate admin tasks with tabcmd

Delete Existing Workbook in Tableau Server

Syntax: tabcmd delete –project <project name> –workbook <workbook name>

Download PNG

Syntax: tabcmd export <Sheet URL> –png -f <Path where PNG needs to saved>

The <Sheet URL> path can be extracted as shown below;

Automate admin tasks with tabcmd
Automate admin tasks with tabcmd

Download PDF (Image)

Syntax: tabcmd get <Sheet URL>  -f  <Path where PNG needs to saved>

The <Sheet URL> path can be extracted as shown below;

Automate admin tasks with tabcmd
Automate admin tasks with tabcmd

Download PDF (Image) with Filters applied

Syntax: tabcmd get <Sheet URL with Filter> -f “<Path to Save the File>

Automate admin tasks with tabcmd

You can also filter the dashboard using fields that are not in the sheet but present in the dataset. In case the string you pass to the filter field has spaces in between (E.g. Home Office) add %20 between the words as shown below;

tabcmd get “/views/Filter_Test/Sheet1?Segment=Home%20Office&Sub-Category=Art” -f “C:\Users\ashwathg\Desktop\tabcmd_tests\FilteR_values_with_space_PDF.pdf”

DOWNLOAD CSV FROM A SHEET

Syntax: tabcmd get <Sheet URL.csv> -f <Path to save CSV File>
tabcmd get “/views/Iowa_Liqour_Sales/Sheet1.csv” -f “C:\Users\user1\Desktop\tabcmd_tests\CSV\Iowa_Liqour.csv”

Make sure that .csv is used at the end of the Sheet URL.

Download PDF (Image) of all Sheets and Dashboards in a Workbook

Syntax: tabcmd export <Sheet URL> –fullpdf –pagesize <required page Size> -f  <Path to save the file>

URL of any of the sheets in the workbook can be utilized to download PDF images of all sheets and dashboards in the workbook

tabcmd export “Insurance_Dashboard/Dashboard1” –fullpdf –pagesize tabloid -f “C:\Users\user1\Desktop\tabcmd_tests\Sheetanddashboard.pdf”

Page size can be;

  1. letter
  2. legal
  3. note folio
  4. tabloid
  5. ledger
  6. statement
  7. executive
  8. a3, a4, a5
  9. b4, b5
  10. quarto
  11. unspecified

The default option is the letter page size.

AUTOMATING PDF DOWNLOAD

In case end-user wants PDF (Image) of the workbook to be downloaded every day at a specific time:

For example, in a notepad file you can specify the following commands;

C:\Program Files\Tableau\Tableau Server\<Tableau Version>\extras\Command Line Utility
tabcmd login -s https://testserver.com  -t test_site -u user1 -p pass123
tabcmd export “Insurance_Dashboard/Dashboard1” –fullpdf –pagesize tabloid -f “C:\Users\user1\Desktop\tabcmd_tests\full_workbook.pdf”
exit

Save the above scripts in notepad as .bat file and add the file to windows scheduler.

To learn more about Visual BI’s Tableau Consulting & End User Training Programs, contact us here.


Corporate HQ:
5920 Windhaven Pkwy, Plano, TX 75093

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

solutions@visualbi.com


Copyright © Visual BI Solutions Inc.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This!

Share this with your friends and colleagues!