You can use the following commands with the tabcmd command-line tool:
Logs in a Tableau user.
Once you log in, the session will continue until it expires on the server or the logout command is run.
If your session has expired and you want to log in using the same information you’ve already used, just specify the --password
option or the --token
option. The server and user name stored in the cookie will be used. (This will not work if --no-cookie
was specified)
If you do not provide a password, token, passwordfile or tokenfile you will be prompted for one. The command will fail if username/password is specified AND token name/token is specified.
Instead of calling the login command, all of the options for this command can be used while calling any other command, to create a session and run the command immediately. For example:
tabcmd login --server x --site y --username u --password p
tabcmd listsites
is the same as
tabcmd listsites --server x --site y --username u --password p
https://prod-useast-b.online.tableau.com
). You can't log in to Tableau Cloud unless you specify the pod.For more information about loggin in, see Logging in.
If you are running the command from a Tableau Server computer that’s on your network, you can use http://localhost. Otherwise, specify the computer’s URL, such as http://bigbox.myco.com or http://bigbox.
If the server is using SSL, you will need to specify https:// in the computer’s URL.
If the server is using a port other than 80 (the default), you will need to specify the port, for example http://servername.com:8000
For Tableau Cloud, specify the full URL including the pod that your site is deployed to. For example: https://prod-useast-b.online.tableau.com/
.
Include this option if the server has multiple sites, and you are logging in to a site other than the default site. To explicitly specify the default site, use quotes around an empty string: “”
The site ID is used in the URL to uniquely identify the site. For example, a site named West Coast Sales might have a site ID of west-coast-sales.
The user name of the user logging in. For Tableau Cloud, the user name is the user’s email address.
Password for the user specified for --username. If you do not provide a password you will be prompted for one.
Allows the password to be stored in the given filename.txt file rather than the command line, for increased security.
Use to specify the HTTP proxy server and port (Host:Port) for the tabcmd request.
Do not prompt for a password. If no password is specified, the login command will fail.
Saves the session ID on login. Subsequent commands will not require a login. This value is the default for the command.
Do not save the session ID information after a successful login. Subsequent commands will require a login.
The number of seconds the server should wait before processing the login command. Default: 30 seconds.
The token name for user.
The token specified for –token-name. If you do not provide a token, you will be prompted for one.
Log in to the Tableau Cloud site with the specified site ID:
tabcmd login -s https://prod-useast-b.online.tableau.com/ -t siteID -u user@email.com -p password
Create a personal access token (PAT) as described in create tokens. For example:
tabcmd login --server “http://exampleserver.com" --site "examplesite" --token-name "tokenname" --token-value "exampletoken"
where:
--token-name
is the token name for user.--token-value
is the token specified for --token-name
Logs out of the server.
tabcmd logout
Adds users to the specified group.
For more information, see CSV Import File Guidelines.
tabcmd addusers "Development" --users "users.csv"
Creates extracts for a published workbook or data source.
A space-separated list of embedded data source names within the target workbook. Enclose data source names with double quotes if they contain spaces. Only available when creating extracts for a workbook.
Create encrypted extract.
Include all embedded data sources within target workbook. Only available when creating extracts for workbook.
Path of the project that is the parent of the project that contains the target resource. Must specify the project name with --project
.
The name of the project that contains the target resource. Only necessary if --workbook or --datasource is specified. If unspecified, the default project ‘Default’ is used.
The canonical name for the resource as it appears in the URL.
The name of the target workbook for extract creation.
Creates a group. Use addusers to add users after the group has been created.
tabcmd creategroup "Development"
Creates a project.
Specifies the name of the project that you want to create.
Specifies the name of the parent project for the nested project as specified with the -n option. For example, to specify a project called “Nested” that exists in a “Main” project, use the following syntax: --parent-project-path "Main" -n "Nested".
Specifies a description for the project.
tabcmd createproject -n "Quarterly_Reports" -d "Workbooks showing quarterly sales reports."
Creates a site.
Used in URLs to specify the site. Different from the site name.
Maximum number of users that can be added to the site.
Allows or denies site administrators the ability to add users to or remove users from the site.
In MB, the amount of workbooks, extracts, and data sources that can be stored on the site.
The extract encryption mode for the site can be enforced, enabled or disabled. For more information, see Extract Encryption at Rest.
Allow or deny users from running extract refreshes, flows, or schedules manually. true to allow users to run tasks manually or false to prevent users from running tasks manually. For more information, see Server Settings (General and Customization).
Create a site named West Coast Sales. A site ID of WestCoastSales will be automatically created, the site will have no storage quota limit, and site administrators will be able to add and remove users:
tabcmd createsite "West Coast Sales"
Create a site named West Coast Sales with a site ID of wsales:
tabcmd createsite "West Coast Sales" -r "wsales"
Prevent site administrators from adding users to the site:
tabcmd createsite "West Coast Sales" --no-site-mode
Set a storage quota, in MB:
tabcmd createsite "West Coast Sales" --storage-quota 100
Adds users to a site, based on information supplied in a comma-separated values (CSV) file. If the user is not already created on the server, the command creates the user before adding that user to the site.
The CSV file must contain one or more user names and can also include (for each user) a password, full name, license type, administrator level, publisher (yes/no), and email address. For information about the format of the CSV file, see CSV Import File Guidelines.
As an alternative to including administrator level and publisher permissions in the CSV file, you can pass access level information by including the --role option and specifying the site role you want to assign users listed in the CSV file.
By default, users are added to the site that you are logged in to. To add users to a different site, include the global --site option and specify that site. (You must have permissions to create users on the site you specify.)
Sets the authentication type (TableauID or SAML) for all users in the .csv file. If unspecified, the default is TableauID.
Do not wait for asynchronous jobs to complete.
Specifies a site role for all users in the .csv file. When you want to assign site roles using the --role option, create a separate CSV file for each site role.
Valid values are: ServerAdministrator, SiteAdministratorCreator, SiteAdministratorExplorer, SiteAdministrator, Creator, ExplorerCanPublish, Publisher, Explorer, Interactor, Viewer, and Unlicensed.
The default is Unlicensed for new users and unchanged for existing users. Users are added as unlicensed also if you have a user-based server installation, and if the createsiteusers command creates a new user, but you have already reached the limit on the number of licenses for your users.
--role
option, use the createusers command instead of createsiteusers.Do not display progress messages for the command.
tabcmd createsiteusers "users.csv" --role "Explorer"
Decrypts all extracts on a site. If no site is specified, extracts on the default site will be decrypted. For more information, see Extract Encryption at Rest.
Depending on the number and size of extracts, this operation may consume significant server resources. Consider running this command outside of normal business hours.
Deletes the specified workbook or data source from the server.
This command takes the name of the workbook or data source as it is on the server, not the file name when it was published.
tabcmd delete "Sales_Analysis"
The name of the project containing the workbook or data source you want to delete. If not specified, the “Default” project is assumed.
Specifies the name of the parent project for the nested project as specified with the -r option. For example, to specify a project called “Nested” that exists in a “Main” project, use the following syntax: --parent-project-path “Main” -r “Nested”.
The name of the workbook you want to delete.
The name of the data source you want to delete.
Deletes extracts for a published workbook or data source.
Include all embedded data sources within target workbook.
Path of the project that is the parent of the project that contains the target resource. Must specify the project name with --project.
The name of the project that contains the target resource. Only necessary if --workbook
or --datasource
is specified. If unspecified, the default project ‘Default’ is used.
The canonical name for the resource as it appears in the URL.
The name of the target workbook for extract deletion.
tabcmd decryptextracts "West Coast Sales"
Deletes the specified group from the server.
tabcmd deletegroup "Development"
Deletes the specified project from the server.
Specifies the name of the parent project for the nested project as specified with the command.
To specify a project called “Designs” that exists in a “Main” project:
tabcmd deleteproject "Designs"` --parent-path "Main"
Deletes the specified site from the server.
tabcmd deletesite "Development"
Removes users from from the site that you are logged in to. The users to be removed are specified in a file that contains a simple list of one user name per line. (No additional information is required beyond the user name.)
By default, if the server has only one site, or if the user belongs to only one site, the user is also removed from the server. On a Tableau Server Enterprise installation, if the server contains multiple sites, users who are assigned the site role of Server Administrator are removed from the site but are not removed from the server.
If the user owns content, the user’s role is change to Unlicensed, but the user is not removed from the server or the site. The content is still owned by that user. To remove the user completely, you must change the owner of the content and then try removing the user again.
tabcmd deletesiteusers "users.csv"
Changes the name of a site or its web folder name. You can also use this command to allow or deny site administrators the ability to add and remove users, or prevent users from running certain tasks manually. If site administrators have user management rights, you can specify how many users they can add to a site.
The name of the site that’s displayed.
Used in the URL to uniquely identify the site.
Maximum number of users who can be members of the site.
Allow or prevent site administrators from adding users to the site.
Set to ACTIVE to activate a site, or to SUSPENDED to suspend a site.
In MB, the amount of workbooks, extracts, and data sources that can be stored on the site.
The extract encryption mode for the site can be enforced, enabled or disabled. For more information, see Extract Encryption at Rest. Depending on the number and size of extracts, this operation may consume significant server resources.
Allow or deny users from running extract refreshes, flows, or schedules manually. true to allow users to run tasks manually or false to prevent users from running tasks manually. For more information, see Server Settings (General and Customization).
tabcmd editsite wc_sales --site-name "West Coast Sales"
tabcmd editsite wc_sales --site-id "wsales"
tabcmd editsite wsales --status ACTIVE
tabcmd editsite wsales --user-quota 50
Encrypt all extracts on a site. For more information, see Extract Encryption at Rest.
Depending on the number and size of extracts, this operation may consume significant server resources. Consider running this command outside of normal business hours.
tabcmd encryptextracts "West Coast Sales"
Exports a view or workbook from Tableau Cloud and saves it to a file. This command can also export just the data used for a view. View data is exported at the summary level. To export detail-level data, you must use the Tableau Server UI. For details, see Download Views and Workbooks.
Saves the file with the given filename and extension.
If you don’t provide a name, it will be derived from the view or workbook name. If you don’t provide a location, the file will be saved to your current working directory. Otherwise, you can specify a full path or one that’s relative to your current working directory.
--csv | --png | --fullpdf [required] |
: Format option. Your format options depend on what’s being exported. A workbook can only be exported as a PDF using the --fullpdf
argument. A view can be exported as a PDF (--pdf) or a PNG (--png) or a csv showing summary data only (--csv).
Sets the page orientation (landscape or portrait) of the exported PDF. If not specified, its Tableau Desktop setting will be used.
Sets the page size of the exported PDF as one of the following: unspecified, letter, legal, note folio, tabloid, ledger, statement, executive, a3, a4, a5, b4, b5, or quarto. Default is letter.
Sets the width in pixels. Default is 800 px.
Sets the height in pixels. Default is 600 px.
?<filter_name>=value
?Parameters.<filter_name>=value
As of tabcmd 2.0.11, an alternate method of setting filters is available. Instead of adding the filter to the end of the URL, add it as another option on the command line. When you use this method, you do not need to encode any characters.
Existing syntax: (can be used in classic tabcmd and Tabcmd 2)
tabcmd export \/WorldIndicators\/Population?Birth%20Rate%20Bin=1.5-3%25 --pdf
New syntax, with no need to encode the parameter values:
tabcmd export \/WorldIndicators\/Population --pdf -f b1.pdf --filter "Birth Rate Bin=1.5-3%"
: <div class="alert alert-info">Note:In both formats, the filter clause cannot contain a colon (:), a comma (,) or an ampersand (&). You must replace each of these characters with an asterisk (*)</div>
To force a fresh data query instead of pulling the results from the cache, add this parameter to the view or workbook url: ?:refresh=yes
Note the following when you use this command:
Permissions: To export, you must have the Export Image permission. By default, this permission is Allowed or Inherited for all roles, although permissions can be set per workbook or view.
Constraints:
To export a workbook, it must have been published with Show Sheets as Tabs selected in the Tableau Desktop Publish dialog box.
The Tableau workbook that contains the admin views cannot be exported.
A dashboard can optionally include a web page object. If you are performing an export to PDF of a dashboard that includes a web page object, the web page object won’t be included in the PDF.
Specifying the view or workbook to export:
Do not use the “friendly name,” and exclude the :iid=<n>
session ID at the end of the URL.
For example, the Tableau sample view Global Temperatures in the Regionalworkbook has a URL similar to this:
To export the Global Temperatures view, use the string Regional/GlobalTemperatures. Do not use Regional/Global Temperatures, or Regional/GlobalTemperatures?:iid=3
Using non-ASCII and non-standard ASCII characters: If you are exporting a view or workbook with a name that includes a character outside the ASCII character set, or a non-standard ASCII character set, you need to URL encode (percent-encode) the character.
For example if your command includes the city Zürich, you need to URL encode it as Z%C3%BCrich:
tabcmd export "/Cities/Sheet1?locationCity=Z%C3%BCrich" -fullpdf
To export a workbook, get the URL string by opening a view in the workbook, and include the view in the string you use.
In the above example, to export the Regional workbook, use the string Regional/GlobalTemperatures
.
tabcmd export "Q1Sales/Sales_Report" --csv -f "Weekly-Report.csv"
tabcmd export -t Sales "Sales/Sales_Analysis" --pdf -f "C:\Tableau_Workbooks\Weekly-Reports.pdf"
tabcmd export "Finance/InvestmentGrowth" --png
tabcmd export "Finance/InvestmentGrowth?:refresh=yes" --png
tabcmd export "Q1Sales/Sales_Report" --fullpdf
tabcmd export "Sales/Sales_Analysis" --fullpdf --pagesize tabloid -f "C:\Tableau_Workbooks\Weekly-Reports.pdf"
Gets the resource from Tableau Cloud that’s represented by the specified (partial) URL. The result is returned as a file.
The url
identifies the view or workbook to be exported. The URL must include a file extension, which determines the type of file returned. A view can be returned in PDF, PNG, or CSV (summary data only) format. A Tableau workbook is returned as a TWB if it connects to a published data source or uses a live connection, or a TWBX if it connects to a data extract.
You specify the url for a view to get using the /views/<workbookname>/<viewname>.<extension>
string, and specify the url for a workbook to get using the /workbooks/<workbookname>.<extension>
string. Replace
--filename
parameter that includes the .pdf or .png extension, you do not have to include a .pdf or .png extension in the URL.?size=??? (optional)
: If the saved file is a PNG, you can specify the size, in pixels, in the URL.
?refresh=yes (optional)
: You can optionally add the URL parameter ?:refresh=yes to force a fresh data query instead of pulling the results from the cache. If you are using tabcmd with your own scripting, using the refresh parameter a great deal can have a negative impact on performance. It’s recommended that you use refresh only when real-time data is required—for example, on a single dashboard instead of on an entire workbook.
Note the following when you use this command:
Permissions: To get a file, you must have the Download/Web Save As permission. By default, this permission is allowed or inherited for all roles, although permissions can be set per workbook or view.
Specifying a view or workbook to get: Specify a view to get using the /views/<workbookname>/<viewname>.<extension>
string. Specify a workbook to get using the /workbooks/<workbookname>.<extension>
string. Replace
For example, when you open a view Regional Totals in a workbook named Metrics Summary, the URL will look similar to this:
/views/MetricsSummary_1/RegionalTotals?:iid=1
Use the string /views/MetricsSummary_1/RegionalTotals.<extension>
to get the view.
Use the string /workbooks/MetricsSummary_1.<extension>
to get the workbook.
tabcmd get "/views/Sales_Analysis/Sales_Report.png" --filename "Weekly-Report.png"
tabcmd get "/views/Finance/InvestmentGrowth.pdf" -f "Q1Growth.pdf"
tabcmd get "/views/Finance/InvestmentGrowth" -f "Q1Growth.pdf"
tabcmd get "/views/Finance/InvestmentGrowth.csv"
tabcmd get "/views/Finance/InvestmentGrowth.png?:size=640,480" -f growth.png
tabcmd get "/views/Finance/InvestmentGrowth.png?:refresh=yes" -f growth.png
tabcmd get "/workbooks/Sales_Analysis.twb" -f "C:\Tableau_Workbooks\Weekly-Reports.twb"
Returns a list of sites to which the logged in user belongs.
tabcmd listsites --username adam --password mypassword
The extract encryption mode for the site can be enforced, enabled or disabled. For more information, see Extract Encryption at Rest.
Returns a list of items of the specified content type on the current site. Possible content types: datasources, flows, projects, workbooks
c:\dev\scratch>tabcmd list projects
Tabcmd 2.0.14
===== Server: https://example.online.tableau.com/
===== Username: jac.fitzgerald@salesforce.com
===== Token Name: example
Tableau Server Site: example
Connecting to the server...
Succeeded
===== Listing projects content for user jac.fitzgerald@salesforce.com...
ID: 1444bd7d-14a6-4d9b-9fc8-140a56288514
NAME: default
c:\dev\scratch>tabcmd list workbooks --details
Tabcmd 2.0.14
===== Server: https://example.online.tableau.com/
===== Username: jac.fitzgerald@salesforce.com
===== Token Name: example
Tableau Server Site: example
Connecting to the server...
Succeeded
===== Listing workbooks content for user jac.fitzgerald@salesforce.com...
<WorkbookItem 94f5f5f7-aab5-4c21-a8cc-0aeb3fc0276b 'Regional' contentUrl='Regional' project=3b99ff06-9f7e-40da-b3cb-9c5162c4a34a>
<ViewItem 36cb75c3-09fb-433e-9767-f75fabb63569 'Obesity' contentUrl='Regional/sheets/Obesity' project=None>
<ViewItem e830fa6f-3332-4bd9-b05d-5ef6e0c71958 'College' contentUrl='Regional/sheets/College' project=None>
<ViewItem 551cd613-2a02-41f6-8d59-86692b2df103 'Global Temperatures' contentUrl='Regional/sheets/GlobalTemperatures' project=None>
<ViewItem 5f9778a8-2218-4a35-9f8b-7ced72f6e423 'Flight Delays' contentUrl='Regional/sheets/FlightDelays' project=None>
<ViewItem 7019c549-aad6-4dd9-bfca-57c8dfcacb85 'Economy' contentUrl='Regional/sheets/Economy' project=None>
<ViewItem 45a75705-c71c-49e6-888e-550e33e580d4 'Stocks' contentUrl='Regional/sheets/Stocks' project=None>
<WorkbookItem cee24c29-b5e1-486b-9003-7df16fbb9f96 'Superstore' contentUrl='Superstore' project=3b99ff06-9f7e-40da-b3cb-9c5162c4a34a>
<ViewItem 95cced5a-a521-476d-aa9f-edf2e1a589ca 'Overview' contentUrl='Superstore/sheets/Overview' project=None>
<ViewItem f85ef1ac-fd9c-4a79-b549-4cf2b6be94c5 'Product' contentUrl='Superstore/sheets/Product' project=None>
<ViewItem eb99055b-a59e-4665-a047-e477afbc6d3a 'Customers' contentUrl='Superstore/sheets/Customers' project=None>
-d, --details Show more detailed info about each object. For workbooks, this will also list each view in the workbook.
Publishes the specified workbook (.twb(x)), data source (.tds(x)), or extract (.hyper) to Tableau Cloud.
If you are publishing a workbook, by default, all sheets in the workbook are published without database user names or passwords.
The permissions initially assigned to the workbook or data source are copied from the project that the file is published to. Permissions for the published resource can be changed after the file has been published.
If the workbook contains user filters, one of the thumbnail options must be specified.
Name of the workbook or data source on the server. If omitted, the workbook, data source, or data extract will be named after filename.
Overwrites the workbook, data source, or data extract if it already exists on the server.
Publishes the workbook, data source, or data extract into the specified project. Publishes to the “Default” project if not specified.
Specifies the name of the parent project for the nested project as specified with the -r option. For example, to specify a project called “Nested” that exists in a “Main” project, use the following syntax: --parent-project-path “Main” -r “Nested”.
tabcmd publish "analysis_sfdc.hyper" -n "Sales Analysis"
--oauth-username "user-name" --save-oauth
If the file is not in the same directory as tabcmd, include the full path to the file.
tabcmd publish "\\computer\volume\Tableau Workbooks\analysis_sfdc.hyper" \
-n "Sales Analysis" --oauth-username "username" -e-save-oauth
Publishes Tableau sample workbooks to the specified project. Any existing samples will be overwritten.
Required. Publishes the Tableau samples into the specified project. If the project name includes spaces, enclose the entire name in quotes.
Specifies the name of the parent project for the nested project as specified with the -n option. For example, to specify a project called “Nested” that exists in a “Main” project, use the following syntax: --parent-project-path "Main" -n "Nested"
.
Publish samples to the Inside Sales project on the Default site, as user jsmith.
tabcmd publishsamples -n "Inside Sales" -t "" -s localhost --username "jsmith" --password "secret-password"
Reencrypts all extracts on a site with new encryption keys. This command will regenerate the key encryption key and data encryption key. You must specify a site. For more information, see Extract Encryption at Rest.
Depending on the number and size of extracts, this operation may consume significant server resources. Consider running this command outside of normal business hours.
tabcmd reencryptextracts "Default"
tabcmd reencryptextracts "West Coast Sales"
Performs a full or incremental refresh of extracts belonging to the specified workbook or data source.
This command takes the name of the workbook or data source as it appears on the server, not the file name when it was published. Only an administrator or the owner of the workbook or data source is allowed to perform this operation.
Run an incremental refresh instead of a full refresh
Adds the full refresh operation to the queue used by the Backgrounder process, to be run as soon as a Backgrounder process is available. If a Backgrounder process is available, the operation is run immediately. The refresh operation appears on the Background Tasks report.
During a synchronous refresh, tabcmd maintains a live connection to the server while the refresh operation is underway, polling every second until the background job is done.
The name of the workbook containing extracts to refresh. If the workbook has spaces in its name, enclose it in quotes.
The name of the data source containing extracts to refresh.:
Use with --workbook or --datasource to identify a workbook or data source in a project other than Default. If not specified, the Default project is assumed.
Specifies the name of the parent project for the nested project as specified with the --project option.
For example:
--parent-project-path "Main" --project "Nested"
--parent-project-path "Main/Nested" --project "Nested2"
The name of the workbook as it appears in the URL. A workbook published as “Sales Analysis” has a URL name of “SalesAnalysis”.
tabcmd refreshextracts --datasource sales_ds
tabcmd refreshextracts --project "Sales External" --datasource sales_ds
tabcmd refreshextracts --project "Sales External" --parent-project-path "Main" --project "Sales External" --datasource sales_ds
tabcmd refreshextracts --workbook "My Workbook"
tabcmd refreshextracts --url SalesAnalysis
Removes users from the specified group.
Remove the users in the given .csv
file from the specified group. The file should be a simple list with one user name per line.
Requires that all rows be valid for any change to succeed. If not specified --complete
is used.
tabcmd removeusers "Development" --users "users.csv"