5 Replies Latest reply on Jun 25, 2015 8:13 AM by Toby Erkson

    Is there a limit to the number of tabcmd syncgroup calls?

    Toby Erkson

      < Self Note > See Jeff's script for auto-syncing AD groups.

       

      I have a script to sync our Active Directory groups on our Tableau Server.  There are only eight AD groups to sync but the batch script gets to the 5th or 6th sync command and stops, waiting for a password.

       

      Here's the batch script.  Note that I only have ONE AD group sync shown below but there are actually 8 total in my full script:

      @ECHO OFF
      REM  by Toby Erkson, January 2014
      REM  No inputs required.
      REM Insure command extensions are enabled, used by the FOR...DO command.
      SETLOCAL ENABLEEXTENSIONS
      
      SET dDate=%DATE:/=%
      SET sLogPath=D:\Application\Tableau\Tableau_Server\logs
      SET sLogName=ADsync.log
      SET mypath=D:\Application\Tableau\Scripts\Get_EncryptedPassword.ps1
      SET encrypted=D:\Application\Tableau\Scripts\encrypted_password.txt
      
      REM Encrypted password functionality added February 2014
      FOR /f "delims=" %%a IN ('powershell . %mypath% %encrypted% ') DO SET pass_word=%%a
      
      ECHO.
      ECHO Adding users from AD groups... (Logging file: %sLogPath%\%sLogName%)
      ECHO ----- BEGIN %dDate:~-4%-%dDate:~4,2%-%dDate:~6,2% %TIME% ----- >> %sLogPath%\%sLogName% 2>&1
      REM --timeout needed to keep connection alive otherwise the session timesout and not all AD groups are updated
      tabcmd login -s "http://dtnaicvdw010.us164.corpintra.net" -u TERKSON -p %pass_word% --timeout 1800 >> %sLogPath%\%sLogName% 2>&1
      
      ECHO Synching CORP_CEEAAdmin >> %sLogPath%\%sLogName% 2>&1
      ECHO %TIME% start ----- >> %sLogPath%\%sLogName% 2>&1
      tabcmd syncgroup "DTNA_CEEAAdmin" --license interactor --no-complete --timeout 1800 >> %sLogPath%\%sLogName% 2>&1
      ECHO %TIME% end ----- >> %sLogPath%\%sLogName% 2>&1
      .
      . Repeat of above 4 lines for each AD group to sync
      .
      
      tabcmd logout >> %sLogPath%\%sLogName% 2>&1
      ECHO ----- END ----- %dDate:~-4%-%dDate:~4,2%-%dDate:~6,2% %TIME% >> %sLogPath%\%sLogName% 2>&1
      ECHO. >> %sLogPath%\%sLogName% 2>&1
      ECHO AD groups user adding to Tableau Server finished.
      REM The /b will return our error level
      EXIT /b %EL%
      
      
      
      
      

       

      Here is the resultant log file:

      ----- BEGIN 2015-06-24  8:58:13.99 -----

      ===== Log out completed.

      ===== Creating new session

      =====     Server:   http://myCorp.Server.com/

      =====     Username: TERKSON

      ===== Connecting to server...

      ===== Logging in...

      ===== Login Succeeded.

      Synching myCorp_CEEAAdmin

      8:58:29.06 start -----

      ===== Continuing previous session

      =====     Server:   http://myCorp.Server.com/

      =====     Username: TERKSON

      ===== Synchronizing server with Active Directory group myCorp_CEEAAdmin...

      ===== Importing Users

       

      Successfully synchronized 75 users in group 'myCorp_CEEAAdmin' with Active Directory.

      0 new users created.

       

      8:58:46.56 end -----

      Synching myCorp_CVD_CascadiaNextGen

      8:58:46.56 start -----

      ===== Continuing previous session

      =====     Server:   http://myCorp.Server.com/

      =====     Username: TERKSON

      ===== Synchronizing server with Active Directory group myCorp_CVD_CascadiaNextGen...

      ===== Importing Users

       

      Successfully synchronized 76 users in group 'myCorp_CVD_CascadiaNextGen' with Active Directory.

      0 new users created.

       

      8:59:06.41 end -----

      Synching myCorp_IT-OCS-VE

      8:59:06.41 start -----

      ===== Continuing previous session

      =====     Server:   http://myCorp.Server.com/

      =====     Username: TERKSON

      ===== Synchronizing server with Active Directory group myCorp_IT-OCS-VE...

      ===== Importing Users

       

      Successfully synchronized 73 users in group 'myCorp_IT-OCS-VE' with Active Directory.

      0 new users created.

       

      8:59:27.31 end -----

      Synching myCorp_CVD_WSTUsers

      8:59:29.21 start -----

      ===== Continuing previous session

      =====     Server:   http://myCorp.Server.com/

      =====     Username: TERKSON

      ===== Synchronizing server with Active Directory group myCorp_CVD_WSTUsers...

      ===== Importing Users

       

      Successfully synchronized 95 users in group 'myCorp_CVD_WSTUsers' with Active Directory.

      0 new users created.

       

      8:59:49.48 end -----

      Synching myCorp_CVD_WSTView

      8:59:49.48 start -----

      ===== Continuing previous session

      =====     Server:   http://myCorp.Server.com/

      =====     Username: TERKSON

      ===== Synchronizing server with Active Directory group myCorp_CVD_WSTView...

      ===== Importing Users

       

      Successfully synchronized 2 users in group 'myCorp_CVD_WSTView' with Active Directory.

      0 new users created.

       

      9:00:05.25 end -----

      Synching myCorp_ITFinanceUsers

      9:00:05.27 start -----

      ===== Continuing previous session

      =====     Server:   http://myCorp.Server.com/

      =====     Username: TERKSON

      ===== Synchronizing server with Active Directory group myCorp_ITFinanceUsers...

      ===== Your session has expired.  Logging in again...

      ===== Log out completed.

      ===== Creating new session

      =====     Server:   http://dtnaicvdw010.us164.corpintra.net/

      =====     Username: TERKSON

      Password:

       

      Right there, see the bold red text?  That suddenly appears and stops the process from finishing   I've set a timeout for 1800 seconds (30 minutes) and as can be seen by the time stamps this process is NOT taking 30 minutes to run.

       

      What gives?  Suggestions?