Wednesday, March 12, 2014

PowerShell and Tableau Server: Automating User Creation and Group Population

UPDATE: I corrected the link to enable secure password storage and recovery in PowerShell.  Apologies for the incorrect link.

As long as Tableau Server runs on Windows machines, an admin's best friend is to leverage PowerShell to automate some everyday tasks.  There have been other great articles on combining Tableau and PowerShell, like Automated PDF Email Distribution by the talented folks at +InterWorks.  

But what, for whatever reason, you need to take down a Tableau Server configured for Active Directory Authentication, restore it as Local Authentication, and recreate the existing users (because the users from a directory will not translate to local authentication).  

Why it just so happens that I have a sample script for that!  To do this, you will need the following items
  • An admin login and password for Tableau server 
  • A csv file with the existing users, their names, and potentially email address'
  • A csv file with the groups and their users
    • Both csv's can be generated using data from the PostgreSQL.  Read here for how to enable that (and search the forums for how to enable read access for all tables/views, not just the default ones!!!)
  • A will and desire to WIN! or just take an otherwise tedious task off your plate.
CLICK HERE for a working powershell script and sample documents.  This method stores the password in the script, though there is a secure method of accomplishing this listed here.

KEY TAKEAWAYS FOR POWERSHELL
Import-CSV: A very power cmdlet to read data from a csv and allow the script to 'play with the results'
select-object: Manipulate the results of a data set (perhaps coming from Import-CSV), much like you would with SQL
.\: This forces PowerShell to run traditional command prompt commands without prompting the user to accept it
foreach: Exact what the name suggests, iterate through every line of a dataset and run a series of commands

Thanks everyone.  Take care and let me know if you have any questions.

5 comments:

  1. I think Tableau is actually the best tool to provide information about some more aspects.It is a very complex and good visualisation tool anyhow.

    Tableau Soap Connection

    ReplyDelete
  2. Great article! It is really helpful for my research. Do post and share more such wonderful content and keep updating.
    Informatica Cloud Training

    ReplyDelete
  3. Casino Review 2021: The Best Casino Games For 2021
    If you're a gambler 카카오 스포츠 or 먹튀폴리스 검증업체 if you're into online gambling, you've 넥스트벳 heard of NetEnt. They have created the 가입머니 지급 사이트 software 호반 그래프 for the gaming industry, with games

    ReplyDelete