Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

read scheduled tasks

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Steve - 13 Aug 2007 19:23 GMT
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
Alexey Smirnov - 13 Aug 2007 20:42 GMT
> 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?

Example: Wrapper Classes for the Windows Task Scheduler
http://mvps.org/emorcillo/en/code/shell/tasksched.shtml

> 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

Why do you want to have a web page? It's a pure Windows task and
basically you don't need any .NET for that. XP/Win2003 have a special
tool for that, schtasks.exe

In the command line type

schtasks /query /s servername

to get result as a file

schtasks /query /s servername /fo CSV /nh >> c:\log.csv

More info: http://support.microsoft.com/kb/814596

Hope this helps
Mike - 13 Aug 2007 20:57 GMT
Ok, thanks I'll check out the wrapper class

Why do you want to have a web page? It's a pure Windows task and
> basically you don't need any .NET for that. XP/Win2003 have a special
> tool for that, schtasks.exe

I want to be able to check every server without logging in or typing the
server names 30 times every day. I want to have the ability to pick my
server, click go and see my results. Then I can print or send an email and
show which jobs failed.

its more of a conveniece thing then anything and to see if it can be done. I
already have a page that does this for SQL jobs, so I wanted to see if I
could do it with Windows task as well.

>> 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.
[quoted text clipped - 23 lines]
>
> Hope this helps
Alexey Smirnov - 13 Aug 2007 22:18 GMT
> Ok, thanks I'll check out the wrapper class
>
[quoted text clipped - 41 lines]
>
> - Show quoted text -

You can also use schtasks.exe and local scheduler on the web server to
create a file, for example, in CSV format. That file can be parsed and
analyzed from ASP.NET. The advantage of this approach is that you
don't need to run the whole ASP.NET application under admin account
who has an access to all remote servers you need to monitor (I guess
you wound need it). If you decided to use the schtasks utility, you
can run it in scheduler with admin account and ASP.NET can be run
under default account.

There's also a hack that allows you to execute schtasks under Win2000
http://www.windowsitpro.com/Article/ArticleID/25186/25186.html

Cheers!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.