Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am attempting to implement a web-based solution on Windows with SQL server. Some batch loads and data FTP needs to be run on the server.

How are batch jobs run in commercial hosted Windows environment? What do I need to ask the hosting company to provide me with (security, remote control software, etc?).

Thank you.

share|improve this question

migrated from programmers.stackexchange.com May 25 '12 at 7:36

This question came from our site for professional programmers interested in conceptual questions about software development.

add comment

1 Answer 1

Most places use the Windows Scheduler / Task Scheduler.

You should be able to find it under the Administrative Tools section of the Start button.
Start -> Control Panel -> Admin Tools -> Task Scheduler or
Start -> Admin Tools -> Task Scheduler
(On XP) Start -> All Programs -> Accessories -> System Tools -> Scheduled Tasks
depending upon which Windows version you're running.

This Dev Center article should get you started with understanding how to use it and how to program against it, if you'd like.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383614(v=vs.85).aspx

IMO, it's about as robust as cron and gives a number of hooks to run as different users as well as some advanced configuration options. You can easily run DOS batch files. It takes a couple of tricks, but you can run Powershell scripts from there. I prefer powershell for the advanced scripting logic capabilities as well as the .NET hooks it provides.

If that doesn't work for you, then you'll need to look at some commercial packages. Task Scheduler has always been sufficient for what I've needed / seen.

Access rights:
At a minimum, you'll need either remote login rights (eg RDP / mstsc) or the ability to start a remote command line session (eg psexec from SysInternals). In theory, you should be able to schedule a task on a remote compute using powershell and the appropriate permissions on the remote system, but I haven't done that before and don't know the exact permissions required.

From there, you'll need access to the Tasks directory (see http://stackoverflow.com/questions/784311/permissions-required-to-create-modify-tasks-in-windows-task-scheduler) and / or the same level of rights that you need your batch jobs to run with.

In other words, if you need your batch job to run as Local System, then you'll need Administrative rights in order to assign LS as the account to run a scheduled task within. If you take a step back and think that through, it should make sense. You can't create a task for a higher privileged account than what you currently have.

FWIW, my preference is to setup a service account with just enough privileges to perform those scheduled tasks. And I would use separate credentials with minimal access rights for the FTP accounts, so the impact when they are compromised is limited.

If you don't have any access to the OS or only interface the SQL Server application / system through a browser, then you may have a problem. Most hosting solutions that I have seen provide you Admin level access, so you should already have these rights but you may not know that you already have them.

share|improve this answer
    
Thank you for your answer. It works best for local or server windows machines but I am wondering if I could get this functionality on a hosted web environment. What administrative rights should I ask the hosting company for? –  Emmad Kareem May 24 '12 at 19:40
    
Thank you for addressing the access rights and the detailed answer. –  Emmad Kareem May 25 '12 at 21:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.