How to programmatically (C#) read Windows Server Task Scheduler job history/log - scheduled-tasks

I have multiple scheduled jobs on a windows Server that run every night starting at 9 PM till midnight.
Is there any programmatic way (C#) to read (export) the Logs/History of each scheduled task and save it to SQL Server or as a text file within the server.
We are tying to show that data on a dashboard.
Thank You

I have researched on this issue and found a solution that worked for me. Created a sample project and is on GitHub.
Please check it out GetTaskSchedulerHistory
Thank You

Related

Irregular Trigger BizTalk Scheduled Task Adapter

I have several receive locations of type schedule in a BizTalk 2016 server. All except one work fine. This one has been getting triggered as defined in the schedule daily at 04:00 am, however it suddenly began to start at 05:00 pm and one day it didnĀ“t run.
There is no Error Log in the Application Logs or the SQL Logs. The Receive Location is enabled. The Server Time is correct.
Does anyone has a hint, what this behavior might be caused by?
BTS 2016
Scheduled Task Adapter 6.0.0.6
The current version is 7.0.2. and that includes some fixes
e.g.
In certain cases task won't trigger in set time with Timespan with Biztalk 2016
Timly Schedule Start Time (and Date) doest not work correct
So I would suggest downloading and installing 7.0.2.
I experienced a similar behavior when the Host Instance is shared and sometimes overloaded. Try to dedicate a HI for scheduling only. And as suggested by #Dijkgraaf, you can use the last version of this Adapter

How to restart an exe when it is exits in windows 10?

I have a process in windows which i am running in startup. Now i need to make it if somehow that process get killed or stopped i need to restart it again in Windows 10?
Is there any way. Process is a HTTP server which if somehow stopped in windows i need to restart it. I have tried of writing a power-shell in which I'll check task-list status of process and then if not found I'll restart but that is not a good way. Please suggest some good way to do it.
I have a golang exe; under a particular scenario my process got killed or stopped i need to start it up again automatically. This has to be done imediately after the exe got killed. What is the best way to achieve this?
I will give you a brief rundown. You can enable Audit Process Termination in local group policy of the machine as shown below. In your case, success audits would be enough. Please note that the pic is for Windows 7. It may change with OS.
Now every time a process gets terminated, a success event will be generated and written to the security eventlog.
This will allow you to create a task scheduler that triggers on the generation of this event that calls a script that would run the process again. Simple right?
Well, you might have some trouble setting that task up especially when you want to pass details about the generating event to the script. This should help you get through that.
You can user Task scheduler for this purpose. There is a option of "restart on failure" which can be selected and whenever your process get failed it will restart again.
Reference :- https://social.technet.microsoft.com/Forums/windowsserver/en-US/4545361c-cc1f-4505-a0a1-c2dcc094109a/restarting-scheduled-task-that-has-failed?forum=winserverManagement

Windows 10 recovery

I want to create an automated task using powershell. The idea of the task is that i start my PC using WOL, it creates a recovery iso and stores it on my NAS. After the iso is created and stored, the PC shuts down.
The wol and shutdown part are already done.
Now i was wondering if the iso part is possible? So that i can create a recovery image stored on an external place. And if there are problems with my pc. I can restore the image i created.
Hope you guys can help me with my question.
Many thanks

Executing Talend jobs with Rundeck

Hello dear community !
I am trying to use Rundeck to monitor and administrate my talend Jobs. I don't really get how to make this work...
I bluid the job in Talend which created a test_run.bat, a test_0.1.jar and 3 folders ( src, project_name, items).
I created a project and a Job in Rundeck, and in the job i inserted the directory to the test_run.bat file in the workflow section.
Of course it failed when I executed the job, I'm stuck...
I'd really appreciate if anyone who already worked with rundeck to execute Talend jobs could help me out !
It is possible. However there are more questions to ask before an answer can be given.
What is the full path to the bat or sh file of the job, on the server where it will be run?
Will the job be run on Windows, Linux, or another platform?
What is the script (rundeck) used to execute the job?
Is the same version of java installed there ?
What error did you get ?
Obvious things to check:
Path and permissions

ms-access 2003 scheduled backup

I have been researching the possibility of scheduling an automatic back up of a database, but every link on the subject just talks about the manual back up process. Can anyone either show how to accomplish setting up a scheduled back up or a link to a good wab based training on the subject.
Microsoft Access is a file based system, so you can use script or a batch file to run in Task Sceduler at any time that you are sure the database will be closed. For example: http://www.overclock.net/t/114345/how-to-automatically-backup-files
We were running an MS Access system for several years and this is how we implemented a backup system.
Our system was split into multiple databases - import, backend and front-end
We had a dedicated desktop PC to run the process. This machine ran the import process and always had the import database open.
There was a form that would be open in the import database with a timer on it.
The timer had code that would run scheduled processes including - import process and backups and even compacting of the database.
There are other ways to perform this type of task, but this was the system that we had.
There are a few drawbacks, including:
If the desktop machine reboots, then the database is closed and nothing will run.