Generating text from scheduled task - c#

I currently write a PowerShell script for monitoring the scheduled tasks from the Windows task scheduler. I got everything to work except the description message for the triggers. I need the Windows generated text that is displayed in the task Scheduler. I can use C# or PowerShell to do this, but I haven't found a way to get this message and I have not enough time to write a generator myself.
Do you guys know a way to do this?
Thank you!

You are looking for Get-ScheduledTaskInfo: link
Syntax:
Get-ScheduledTaskInfo
[-TaskName] <String>
[[-TaskPath] <String>]
[-CimSession <CimSession[]>]
[-ThrottleLimit <Int32>]
[-AsJob]
[<CommonParameters>]
Using the cmdlet without parameters will show all running scheduled task and their information.

Related

How do you show console output from C# Windows app started by task manager?

I have a C# console application that sends constant output to the console via console.writeline. Works fine if I invoke it manually. Now I want it to be started by task scheduler. The app is started OK, but the output does not appear anywhere. The data is real time output so writing to a file is not an option.
How do I get it to show?
I cant write a comment (less than 50 rep), but you might also want look into this?
Where is Task Scheduler console output? (C# console app)
I know that this is for files again..
If your application does not have to be that real-time capable you can print the output into a text file and read that file from another program. If you do this remember to check if the file is available or right now read or written to by the other program

Creating custom tasks in Biztalk scheduled task adapter

I need to run my Biztalk orchestration for every two hours and trigger will be a file that is present in location say "Folder2"
So I used folders "Folder1" and "Folder2". I copy files from "Folder1" to "Folder2" on timely basis(say for every two hours).I acheived this by writing some C# code and giving exe of this console application as Task in windows scheduler.
"Folder2" is configured as receive location in BizTalk application. So as soon as files are moved to "Folder2" they trigger BizTalk orchestration
Now I want to try with BizTalk scheduled task adapter.I can not use "XmlStringStreamProvider" as I want to strictly use files present in "Folder2".
Is there any possibility to run exe of C# appllication, in Task like in case windows scheduler?
Am completely new to it :-( Any suggestions would be of real help. Thanks in advance.
The answer to your specific question could be yes, but I wouldn't take that path. What you'd have to do is write a custom task that runs the .exe.
The Interface for the Scheduled Task Adapter is pretty simple so I strongly recommend you just implement the functionality directly rather than try to reuse the .exe.
All you have to do really is stream copy the contents of the file in Folder2 into the BizTalk Message submitted by the Task.

Exchange Web Service Managed API: How to get Task from E-Mail?

I am using EWS to get some E-Mails, everything works fine but now i have to implement the "CompleteDate" which is set when someone uses this Red Flag in Outlook to set it to a Task.
I searched everything but i dont find a way to get the task from the E-Mail.. i tried to bind the Mail as a Task but id didnt work:
Task task = Task.Bind(service, item.Id);
Could anyone help me out here?
What can help is make use of IlSpy for viewing the DLL.
A other great tool is EWSEditor. Its free and you can use it to read items based on EWS.
A e-mail cant be a task, you dont have the properties for the task.
To get the task you need to search by subject.
See example: http://code.msdn.microsoft.com/Exchange-2013-Find-tasks-0d2633ec
(With coding example)

How to make a system event application in c#?

I am trying to make the following. I have a class that at midmight it makes a log from what happened in a SQL table and makes an excel file of it. My issue is that I was told that it is inexcusable to have this application running all day only to have it run once a day and that I should do this with a system event, but I have no idea how to do this. Help, please?
The easiest solution is to use Windows' built in Scheduled Task support to run your app. Or, if you're using Microsoft Sql Server, a scheduled Sql Agent job.

Email scheduling in C# (ASP .NET)

Hi want to send birthday emails to all employees which details are stored in database.
I found Quartz .NET library
but can't understand the code exactly.
can anyone please give me some sample code.?
This is the first time I heard about Quartz. It looks cool.
Found this stackoveflow thread How to use Quartz.net with ASP.NET
Further to Ives - answer:
What about from their website:
http://www.quartz-scheduler.org/docs/examples/index.html
This blog maybe of help as well..
http://blog.goyello.com/2009/09/21/how-to-use-quartz-net-in-pro-way/
Stack Overflow Question
Sending Periodic Mail according to user's Setting in ASP.net?
I guess this is something similar here.
You can code a small console application, a simple database with 1 table as you said which keeps dates,names and other details you need.
Simply select all rows which meets condition
Birthday == DateTime.Now
and mail them in a loop.
You can add this exe as a scheduled job with a few clicks and set it to run every day. It would also be a good practice for you.
You can write a script file (possibly in VBScript as a VBS file) and schedule that script file in the Windows Task Scheduler (say every morning 8 AM) on the server level.

Categories

Resources