2 Replies Latest reply on Jan 23, 2017 12:41 PM by Lee Forst

    Tabadmin, PowerShell, Windows Task Scheduler, and UAC

    Lee Forst

      I’m working on bettering my Server housekeeping stuff and I’ve ran into a bit of a problem.  I’m using Tabadmin to do the usual housekeeping tasks and I’m doing this within a PowerShell script.  The script itself is doing everything I need it to when I manually run it in PS ISE.  However, the problem comes to when I schedule this script in Windows Task Scheduler.

       

      The problem seems to be around UAC and the fact that Tabadmin requires administrative approval to run.  To illustrate the problem, consider the following PowerShell commands in a script file called test.ps1.

       

      $tableauinstalldirectory = "D:\Program Files\Tableau\Tableau Server\10.1\bin"

      cd $tableauinstalldirectory

      .\tabadmin.bat autostart

       

      Then consider the following Windows Task Schedule configuration.

       

       


      Note the user account configured in the General tab is a domain service account I have for running Tableau on my server.  Also note, the “Run with highest privileges” checkbox is checked.

       

      When I kicked off this task it just runs for ever.  My assumption is because the Windows approval screen comes up to allow Tabadmin to “make changes to my computer”.

       

      So for grins, I changed UAC to never notify.  While this prevents the above dialog from appearing when I manually run the script, it does not work when the Task is executed.

       

      To prove this was in fact the problem, I put the domain service account into the local Administrators group on my server and tried it again.  The task completed within a few seconds.

       

      My question is, how are you getting around this other than placing your domain account into an administrators group (bad practice)?