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
> 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!