473,598 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 14686
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*******@disc ussions.microso ft.com> wrote in message
news:3C******** *************** ***********@mic rosoft.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("S cheduler.Schedu lingAgent.1")
Dim TaskName

Set objTask = oScheduler.Task s.Add("CheckReg istrationRemind er")
TaskName = "C:\WINNT\syste m32\wscript.exe """ & "C:\Program
Files\NellieAdm in\" & "CheckRegistrat ionReminder.vbs """
objTask.Applica tionName = TaskName
objTask.Comment = "blah blah some comment"
objTask.Creator = "Script File"
objTask.Working Directory = "C:\WINNT\syste m32"

--
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*******@disc ussions.microso ft.com> wrote in message
news:3C******** *************** ***********@mic rosoft.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("S cheduler.Schedu lingAgent.1")
Dim TaskName

Set objTask = oScheduler.Task s.Add("CheckReg istrationRemind er")
TaskName = "C:\WINNT\syste m32\wscript.exe """ & "C:\Program
Files\NellieAdm in\" & "CheckRegistrat ionReminder.vbs """
objTask.Applica tionName = TaskName
objTask.Comment = "blah blah some comment"
objTask.Creator = "Script File"
objTask.Working Directory = "C:\WINNT\syste m32"

--
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.Sche dulingAgent.1'

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

TIA,

Colin
Jul 19 '05 #4
"Colin Steadman" <an*******@disc ussions.microso ft.com> wrote in message
news:26******** *************** ***********@mic rosoft.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("S cheduler.Schedu lingAgent.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.Sche dulingAgent.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
7018
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 scheduled task. What I wanted to do was, at the end of the scheduled task is then call the
6
3170
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, but displays no error. There is no entry in the job history. The same thing happens when I try to run the individual jobs from Enterprise Manager. I've checked the database recovery model (full), the location of the backup files (same as the...
5
4565
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, etc. All my command scripts utilizing this console application work fine when they are executed interactively. However, if they are executed via a scheduled task, they do not run. Or more precisely, the script seems to execute at the...
2
2912
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 users who have checked out materials for over two weeks. I can figure out how to do everything but time the query for the database to get the list of users. My initial idea is to have a small class that would have a timer running in the...
6
8231
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, but I need to launch the add tasks wizard inside the folder. Does anyone have any ideas of how to do this? I can't find anything in the MSDN regarding this. All it mentions is the Task Scheduler API and I can't seem to find it in there either. Did...
4
3236
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 application is dynamic in nature and requires user input, but the point is that it isn't a one off application. I would like to be able to modify the application to receive the params via the commandline and somehow run automatically off of a set...
3
6360
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 server? So I want a web page, it will have a drop down box with all the servers I log into every day. I then want to select a server and read the all the Scheduled tasks and list them in a grid view. Is this possible using C# and ASP.NET
9
3766
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 directory. This exe does the following 3 things: 1.) Using the VB Interaction SaveSetting() method, it programmatically updates the system registry under the HKEY_CURRENT_USER\SOFTWARE key and saves a directory location used by a PDF driver (so that...
2
1815
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
7981
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7894
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8284
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8262
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5437
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2410
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1500
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.