This is a continuation of the Tasks series of blog posts:
Tasks – Part 1: Tasks Overview
Tasks - Part 2: Custom Console Tasks for Create, Edit, Delete
In this blog post we will look at creating command line console tasks. These are the easiest kind of console tasks to create. The basic idea is to execute any kind of executable file on the file system locally on the computer where the console is running or remotely on a network share via a UNC path.
For this illustration I have created a very simple executable (.exe) which simply writes out the standard output whatever is passed in as the first parameter value. This is the program:
static void Main(string[] args)
{
Console.WriteLine(args[0]);
}
Whatever is passed in for the first parameter value is simply written to standard out like this:
Now, I’ll show you how to make this Show ID task show up in the console whenever an incident is selected.
You can also do this with named parameters. You just need to put the parameter name in there before the $….$ value substitution string.
“Log in action log when this task is run” is used to capture the output of the task and automatically add it as an action log entry in those objects that have an action log (incident and problem for example).
“Show output when this task is run “ is used to decide whether or not to display the output in a popup dialog. Some tasks like this one we are creating or something like ping.exe will have output and it should be displayed in the UI. Other tasks have no output like launching an MMC snapin or starting remote desktop. In those cases the checkbox should be unchecked .
When you click it the incident ID will be passed on the command line and it will be shown in the popup dialog:
Here is another example from Marcel Zehner:
Starting the SCCM Remote Control Client from the Service Manager Console
Starting the SCCM Remote Control Client from the Service Manager Console, Part 2 (aka “how to d...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.