1 2 3 Previous Next 34 Replies Latest reply on Jan 11, 2018 1:01 PM by Toby Erkson

    Password encryption with tabcmd

    rahul.subramanian

      Hi.

      I am using tabcmd to export certain data into csv (but obvious ). But the question is i am slightly paranoid when it comes to letting my password be in the open.

      I would like to encrypt my password when it is being passed. I am not that sound when it comes to programming. I would like to ask if it is possible to encrypt a password present in a file and when that is passed with the "--password-file" option how will tabcmd accept it.

      I work in a college lab so there is not much security in just passing the password as a file and encrypting the file using Win Encryption as it would be a minute's job for anyone to find out my password.

       

      Please help

       

      Thanks

       

      Subro

        • 1. Re: Password encryption with tabcmd
          Toby Erkson

          Sorry, it can't be done.  tabcmd is expecting the password and has no means to perform de/encryption whether it's from a file or on the command line.

          Your option is to not include the password.  However, this would require you to manually type it in when running a batch script.  Not ideal but definitely safe.

          1 of 1 people found this helpful
          • 2. Re: Password encryption with tabcmd
            Jim Wahl

            I thought Subro was referring to the connection between tabcmd and Tableau Server. You wouldn't think they'd send a clear text password, but I haven't checked and I suppose tabcmd is intended for use in a trusted environment.

             

            But I recently saw an exmaple here that might allow you to execute tabcmd with an encrypted password file using Windows credential objects:

            https://www.interworks.com/blogs/trhymer/2013/07/08/powershell-how-encrypt-and-store-credentials-securely-use-automation-script

             

            The Interworks example is using the SMTP client. I don't think tabcmd can be scripted this way---you have to pass command line arguments---but you can retrieve the password from an encrypted credential file using (after line 7 in their example) with :

            $credential.GetNetworkCredential().Password

             

            Jim

            1 of 1 people found this helpful
            • 3. Re: Password encryption with tabcmd
              Toby Erkson

              Dang Jim, nice!  However, the OP isn't a strong programmer so it's a 50/50 solution.

              • 5. Re: Password encryption with tabcmd
                rahul.subramanian

                Jim Wahl: Thanks for the reply. I will see the post and then apply it to my benefit. Thanks once again.

                Toby Erkson: Thanks for your prompt reply.Thanks for your concern. I might not be a programmer but i am pretty quick learner. I will do something with what i know and what i dont will learn and then apply.

                 

                Thanks both of you for the reply.Looking forward to learn more.

                1 of 1 people found this helpful
                • 6. Re: Password encryption with tabcmd
                  Jim Wahl

                  You're welcome.

                   

                  Remember that to run a powershell script (the four line text file in the Interworks blog post), you'll need to run PowerShell as an admin (right-click > Run as...) and change the execution policy by typing

                  Set-ExecutionPolicy RemoteSigned

                   

                  Jim

                  • 7. Re: Password encryption with tabcmd
                    Sean Mullane

                    Just ran across this post and put it into practice. Works great! Thanks Jim!

                    • 8. Re: Password encryption with tabcmd
                      Toby Erkson

                      Here's a document I created to help others out as I did not find it easy to do since I'm not a PowerShell user:

                      http://community.tableau.com/docs/DOC-5423

                      I am successfully using this method on my server now.  Hope it helps others

                      1 of 1 people found this helpful
                      • 9. Re: Password encryption with tabcmd
                        Luke Brady

                        Toby Erkson Thank you for this!  Your instructions were perfect!  I really did not want to put the admin password in a free text file and this helped me obfuscate it.

                        • 10. Re: Password encryption with tabcmd
                          Umang Desai

                          Hello Toby,

                          I just followed your document for password encryption on my tableau server in order to export reports using tabcmd command.

                          I think I followed thoroughly but I still got stuck. When I run the script it tries to login into tableau server and gives me 404 not found error.

                          I also set the "PATH" variable for powershell just like you have mentioned in your document.

                          I was able to generate encrypted_password.txt file with encrypted password in it but somehow script is not able to get that password to login into the server.

                           

                          I am not sure what i am doing wrong.

                          Would you be able to help me.?

                           

                          Here is my script

                           

                          @ECHO OFF

                          REM BY UMANG DESAI

                          REM Export Tableau Reports and generate index fils for each report.

                           

                           

                          SETLOCAL ENABLEEXTENSIONS

                           

                           

                          SET dDate=%DATE:/=%

                           

                           

                          cd "C:\Program Files\Tableau\Tableau Server\10.4\bin"

                           

                           

                          SET ScriptPath=C:\Program Files\Tableau\Tableau Server\10.4\bin

                          SET mypath=%ScriptPath%\Get_EncryptedPassword.ps1

                          SET encrypted=%ScriptPath%\encrypted_password.txt

                           

                           

                          FOR /F "delims=" %%a IN ('powershell . %mypath% %encrypted% ') DO SET pass_word=%%a

                           

                           

                          tabcmd login -s "http://192.168.2.206" --no-certcheck -u CUDOMAIN\administrator -p "%pass_word%"

                           

                           

                          tabcmd export "/NegativeAccountswithDaysCountReport/NegativeAccountswithDayCount" --fullpdf --width 1920 --height 1200 --pagelayout landscape -f "\\ECM-APP\Tableau

                           

                           

                          \NegativeAccountswithDayCount.pdf"

                           

                           

                          tabcmd export "/MonetaryTransactionwithA-OReport/MonetaryTransactionwithA-OReport" --fullpdf --width 1920 --height 1200 --pagelayout landscape -f "\\ECM-APP\Tableau

                           

                           

                          \MonetaryTransactionwithA-O.pdf"

                           

                           

                          tabcmd logout

                           

                           

                           

                          pause

                           

                           

                           

                          ECHO ON

                           

                           

                          • 11. Re: Password encryption with tabcmd
                            Toby Erkson

                            Umang Desai wrote:

                             

                            ...

                            I think I followed thoroughly but I still got stuck. When I run the script it tries to login into tableau server and gives me 404 not found error.

                            I also set the "PATH" variable for powershell just like you have mentioned in your document.

                            I was able to generate encrypted_password.txt file with encrypted password in it but somehow script is not able to get that password to login into the server.

                            ...

                            Here is my script

                             

                            @ECHO OFF
                            REM BY UMANG DESAI
                            REM Export Tableau Reports and generate index fils for each report.
                            
                            SETLOCAL ENABLEEXTENSIONS
                            SET dDate=%DATE:/=%
                            cd "C:\Program Files\Tableau\Tableau Server\10.4\bin"
                            SET ScriptPath=C:\Program Files\Tableau\Tableau Server\10.4\bin
                            SET mypath=%ScriptPath%\Get_EncryptedPassword.ps1
                            SET encrypted=%ScriptPath%\encrypted_password.txt
                            
                            FOR /F "delims=" %%a IN ('powershell . %mypath% %encrypted% ') DO SET pass_word=%%a
                            tabcmd login -s "http://someAddress.com" --no-certcheck -u CUDOMAIN\administrator -p "%pass_word%"
                            tabcmd export "/NegativeAccountswithDaysCountReport/NegativeAccountswithDayCount" --fullpdf --width 1920 --height 1200 --pagelayout landscape -f "\\ECM-APP\Tableau\NegativeAccountswithDayCount.pdf"
                            tabcmd export "/MonetaryTransactionwithA-OReport/MonetaryTransactionwithA-OReport" --fullpdf --width 1920 --height 1200 --pagelayout landscape -f "\\ECM-APP\Tableau\MonetaryTransactionwithA-O.pdf"
                            tabcmd logout
                            
                            pause
                            ECHO ON
                            

                             

                            Hmm, it looks okay to me.  We need to know exactly at what line the not found error occurs.

                             

                            FYI:  You don't need to set the dDate variable (line 6 above) as you aren't using it.

                            • 12. Re: Password encryption with tabcmd
                              Umang Desai

                              Hello Toby,

                              I didnt get anything in your reply here.

                               

                              Did you send something?

                              • 13. Re: Password encryption with tabcmd
                                Toby Erkson

                                "...wip..." = Work In Progress.  I needed to spruce up your code to make it easier to read.  My reply has been updated.

                                • 14. Re: Password encryption with tabcmd
                                  Umang Desai

                                  I am not sure what line it is giving me that error. It does try to login when I ran the script. It gets the server, username but i believe it is not getting password. I am not sure.

                                   

                                  I have store all the script files in same folder.

                                  I have to use

                                  1. cd "C:\Program Files\Tableau\Tableau Server\10.4\bin" 

                                    in order to execute tabcmd command because thats where it is installed

                                   

                                  1 2 3 Previous Next