473,238 Members | 3,709 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,238 software developers and data experts.

Start A Scheduled Task From ASP Server

We have a number of scheduled tasks on our IIS server that run daily at some point during the early morning. These tasks run as a specific user that has the correct permissions to perform whatever task (processing SQL so I'm told)

I have been asked if I can setup a page within ASP that a user could logon to with their own credentials (this I can do).

And once logged on be presented with a list of scheduled tasks which they can then restart by clicking a button. The idea is to give them the abiltity to manually run a job, but within giving them the password to the admin account that the sceduled task uses

Does anyone have any thoughts on how this might be done? Would it be as simple as shelling out to the Scheduled Task shortcut and running it

TIA

Coli
Jul 19 '05 #1
4 14626
Colin Steadman wrote:
We have a number of scheduled tasks on our IIS server that run daily
at some point during the early morning. These tasks run as a
specific user that has the correct permissions to perform whatever
task (processing SQL so I'm told).

I have been asked if I can setup a page within ASP that a user could
logon to with their own credentials (this I can do).

And once logged on be presented with a list of scheduled tasks which
they can then restart by clicking a button. The idea is to give them
the abiltity to manually run a job, but within giving them the
password to the admin account that the sceduled task uses.

Does anyone have any thoughts on how this might be done? Would it be
as simple as shelling out to the Scheduled Task shortcut and running
it?

TIA,

Colin


Are you talking about SQL Agent scheduled tasks (jobs)? Or batch jobs
scheduled using the AT command?

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #2
"Colin Steadman" <an*******@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...


----- Bob Barrows wrote: -----
Are you talking about SQL Agent scheduled tasks (jobs)? Or batch jobs
scheduled using the AT command?

I've just spoken to the customer and asked this question.

The story has changed somewhat. He now says that the job has not yet been setup, and that he's expecting me to do this bit as well (in whatever way I
feel appropriate). A VBScript would be perfect I think. Can I start a
VBScript and have it run in the background with the credentials of a user of
my choice? TIA


Try something like this: ( I don't remember where I got this from)

Dim oScheduler
Dim objTask
Dim objTrigger
Set oScheduler = CreateObject("Scheduler.SchedulingAgent.1")
Dim TaskName

Set objTask = oScheduler.Tasks.Add("CheckRegistrationReminder")
TaskName = "C:\WINNT\system32\wscript.exe """ & "C:\Program
Files\NellieAdmin\" & "CheckRegistrationReminder.vbs """
objTask.ApplicationName = TaskName
objTask.Comment = "blah blah some comment"
objTask.Creator = "Script File"
objTask.WorkingDirectory = "C:\WINNT\system32"

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #3


----- Tom Kaminski [MVP] wrote: -----

"Colin Steadman" <an*******@discussions.microsoft.com> wrote in message
news:3C**********************************@microsof t.com...
----- Bob Barrows wrote: -----
Are you talking about SQL Agent scheduled tasks (jobs)? Or batch jobs
scheduled using the AT command?
I've just spoken to the customer and asked this question.
The story has changed somewhat. He now says that the job has not yet been

setup, and that he's expecting me to do this bit as well (in whatever way I
feel appropriate). A VBScript would be perfect I think. Can I start a
VBScript and have it run in the background with the credentials of a user of
my choice? TIA


Try something like this: ( I don't remember where I got this from)

Dim oScheduler
Dim objTask
Dim objTrigger
Set oScheduler = CreateObject("Scheduler.SchedulingAgent.1")
Dim TaskName

Set objTask = oScheduler.Tasks.Add("CheckRegistrationReminder")
TaskName = "C:\WINNT\system32\wscript.exe """ & "C:\Program
Files\NellieAdmin\" & "CheckRegistrationReminder.vbs """
objTask.ApplicationName = TaskName
objTask.Comment = "blah blah some comment"
objTask.Creator = "Script File"
objTask.WorkingDirectory = "C:\WINNT\system32"

--
Tom Kaminski IIS MVP
Thanks Tom,

Slight problem with it though. Apparently it needs the task scheduler dll which is only available on Microsoft Site Server 3.0 according to this post:

http://groups.google.com/groups?hl=e...207.126.101.92

Otherwise you get this error:

Microsoft VBScript runtime error '800a01ad'

ActiveX component can't create object: 'Scheduler.SchedulingAgent.1'

/ColinsDevArea/tasks.asp, line 46
Any other ideas?

TIA,

Colin
Jul 19 '05 #4
"Colin Steadman" <an*******@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
----- Tom Kaminski [MVP] wrote: -----

Try something like this: ( I don't remember where I got this from)

Dim oScheduler
Dim objTask
Dim objTrigger
Set oScheduler = CreateObject("Scheduler.SchedulingAgent.1")
Dim TaskName

Slight problem with it though. Apparently it needs the task scheduler dll which is only available on Microsoft Site Server 3.0 according to this post:
http://groups.google.com/groups?hl=e...207.126.101.92
Otherwise you get this error:

Microsoft VBScript runtime error '800a01ad'

ActiveX component can't create object: 'Scheduler.SchedulingAgent.1'

/ColinsDevArea/tasks.asp, line 46
Any other ideas?


I think WMI might be the way to go, I was able to find this:
http://msdn.microsoft.com/library/de...heduledjob.asp

--
Tom Kaminski IIS MVP
http://www.iistoolshed.com/ - tools, scripts, and utilities for running IIS
http://mvp.support.microsoft.com/
http://www.microsoft.com/windowsserv...y/centers/iis/

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Greg D. Moore \(Strider\) | last post by:
Ok, I thought this one would be easy. I have a stored proc: master.dbo.restore_database_foo This is on database server B. Database server A backs up database foo on a daily basis as a...
6
by: Iain Hosking | last post by:
I am running a SQL Server 2000 installation with several databases. Each database and log is backed-up using a maintenance plan. The scheduled maintance plan for the latest database does not run,...
5
by: A. Lovhaug | last post by:
I have a console application built in the .NET Framework. This application basically executes an XCopy based on parameters that I pass to it. I use it for creating scripts for backing up folders,...
2
by: Bob Cummings | last post by:
Greetings I am working on a Senior Project for school. It is a simple ASP.NET on line card catalog for an in-house library. One of the requests the client has is to send an email reminder to...
6
by: John Bowman | last post by:
Hi, I have a C# app that needs to launch the "Add Scheduled Tasks" wizard found in the control panel "Scheduled Tasks" applet. I realize that this "applet" really just opens the tasks folder,...
4
by: RSH | last post by:
I have an application that creates an Access version of a SQL Server database and then it moves the resulting database to an ftp server for the client to download and run reports against etc. The...
3
by: Steve | last post by:
Here is what I want to do. Currently I have to log into 30 servers every morning and see if all the jobs under 'scheduled tasks' ran. Is there a way from .NET to read that directory for the selected...
9
by: jdaelhousen | last post by:
I have a bit of a problem I'm hoping someone can shed some light on... I have a VB.Net console application written in VS 2003 that produces a .exe file that now sits on a Windows 2000 server...
2
by: thj | last post by:
Hi, Is it possible to start an scheduled task on a server from ASP.NET? Thanks in advance. Tommy.
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.