Leverage PowerShell and Tableau to Extract Server Datasources

Leverage PowerShell and Tableau to Extract Server Datasources

Mike Roberts
//

Question:

Of all the workbooks on Tableau Server, which (1) use a Tableau Server data source and (2) what workbook(s) use them?

Answer:

Since there’s no simple and straightforward way to extract this information from the default views on Tableau Server (_datasources, etc.), we’ll use a short and sweet PowerShell script to do the heavy lifting for us.

Since each Tableau workbook contains all the information about connections, calculations, etc., we’ll use our script to run through each of them and extract the information we need.

Step 1:
Pull down the attached PowerShell script and update the $input_path and $output_file variables to your specific requirements (where are your Tableau workbooks and where do you want the results to go, respectively). Save this file as a ‘.ps1’ file and save to the desired path.

Step 2:
Open Windows PowerShell (Windows + R) and type “powershell”.  Navigate to the directory where you saved the file from Step 1.

powershell

Step 3:
Run the script by typing: ‘ .{your file name}.ps1 ‘ Note: You may have to make sure you are able to execute these scripts. Check here: http://technet.microsoft.com/en-us/library/ee176949.aspx

$input_path = ‘c:UsersmrobertsDocumentsMy Tableau RepositoryWorkbooks*.twb’
  $output_file = ‘c:usersmrobertsdata.csv’
  $regex = ‘(?

Step 4:
You now have a listing of all your workbooks that use a Tableau Server data source.

Need Expert Help?

See Our Full Menu of Data Services

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK

×

Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072

×

Love our blog? You should see our emails. Sign up for our newsletter!