Windows Scheduled Tasks and Permissions

Posted on 2008-11-15
Last Modified: 2012-05-05
Here's my construct:
1. I created a BAT file named EXEC_spRTMaster.bat that calls a SQL Server command named SQLCMD (which in turn runs a sproc named spRTMaster).  When called manually, the BAT file runs successfully.
2. I created a Windows Scheduled Task to call EXEC_spRTMaster.bat.  When the Windows Scheduled Task is associated with account in Domain Admins, it runs successfully.
3. I created a Domain User account named RTScheduler.  I gave RTScheduler full permissions to the Scheduled Task.  I also gave RTScheduler full permissions to the folder containing EXEC_spRTMaster.bat.  
4. Yet, when I run the Scheduled Task while its associated with RTScheduler as the user, EXEC_spRTMaster.bat does not run.

It seems like I still need to grant another permission somewhere?  Or, perhaps there's another process (associated with a different domain account) that's sneaking into the process?
Question by:jdana
    LVL 8

    Accepted Solution

    It's definatly a permissions issue. Does the Domain Users account you created have the correct permissions to the SQL Server?

    Try giving the Domain Users account Administrative Access to the SQL Server (or Database you are running the command on) and then try again.


    Author Comment

    I didn't give RTScheduler permissions on SQL Server because SQLCMD is run by sqlservr.exe and it's associated with the Local System account (which in turn is a member of sysadmin role on SQL Server).  It sure can't hurt, however.  I'll give it a shot.

    Too many layers!

    Author Comment


    It worked.  I'm stumped.  I still don't get why RTScheduler needed any kind of SQL permission.  Maybe if it's calling the BAT file via Windows Scheduler, it's taking over for Local System?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Several part series to implement Internet Explorer 11 Enterprise Mode
    If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now