Deployment Solution

 View Only

How to Create Alias (Pointer) Jobs in Deployment 6.x 

Mar 27, 2009 08:24 AM

For many years I have been organizing jobs in the Deployment console by putting them into folders.  Placing jobs into folders makes it easy to deploy a set of jobs "as one".  For example, we have a set of Standard Installs that are all in a folder and are applied to each PC as it is imaged.  But some of the component jobs (like Symantec Antivirus) can occasionally be applied to machines that are managed in the console but are not being imaged at that time.  In the past that meant having two jobs for the SAV install, one in the Standard Installs folder and another filed under the more general "Symantec" folder.

Having two jobs that do the same thing leaves you open for issues down the road.  If you craft the job just so you can control the script behind the job and then by updating the script you end up updating all jobs that point to that script.  But if the job does anything else - places down an image, gets inventory, or branches due to logic (lab machines vs. staff machines) the different jobs that perform the same function can drift apart and introduce uncertainty over time.

One day I stumbled across the solution: create alias (pointer) jobs that all point to the "main" job.  You can then put these pointer jobs in any folder, and they will always do the same thing because they all just call one central job.  If you make changes to the central job then all pointer jobs are updated (in effect).

This example was done on a Deployment Solution 6.9 (build 164) console, but the methods mentioned should work the same on older consoles as well.

Using the method I outline in the steps below, you will create alias jobs that, once run, will cause a second job to be scheduled right after the alias job.  To get started:

First create a job like you normally would, and give it a name.  You may want to add a description which states that the job you are creating is a pointer job.  See image below.

imagebrowser image

For our example we are going to use the Default condition.  You could get more sophisticated and use different conditions to point to different jobs depending on your needs.  The same basic principal will apply to each condition, just make sure (like always) that there is a default condition to fall back to.

Now add a Script action to the Job you just created.  Choose Run this script: as the action choice, and enter a Remark in the scripting body.  I like to Remark that this is a Pointer Job by entering

            REM Pointer Job

then clicking on Next.

See the example in the image below.

In the Script Information dialog box, leave most of the defaults as they are:

            Script Run Location: On the client computer

            Client Run Environment: Production - Client-installed OS

            Security Context: Default

One change that I do recommend is to change the Script Window under Script Options to run the script Hidden.  The short REM script that we wrote will not be on the screen for very long, but popping windows up for end users is never a good thing for the service desk staff.  Click on Next when you are done.

Now for the most important step.  In the Return Codes dialog box, choose Select a Job…. under the Success (0) return code choice.  Since the REM script we wrote is so simple it will ALWAYS return a 0 if run under the system default user the result of the script will be to… select another job!
imagebrowser image

The Select a job dialog box should open.  You can point to any job in your Deployment Console EXCEPT the job you are currently running.  This is the main job, the job which will now run immediately following the execution of the pointer job.  See the image below for a simple example.
imagebrowser image

Any number of pointer jobs can point to the same main job, and you can make copies of the pointer jobs to put them into other folders - no need to change anything other than the "copy of" at the front of the job name.

One last tip:  Even with the description being set and the remark in the script for the job, it can be hard at times to determine the difference between a "real" job (the main job) and a pointer job.  I like to put the text "(a)" at the end of the name for each pointer job.  That makes it easier to tell which is which when viewing a history of jobs for a computer.  It is also nice to name the job something that indicates what the job points to (not as we did in this example - the pointer job in this example might have been better named "DIR Command (a)").

Below is what a pointer job calling a main job will look like in the console:

imagebrowser image
The DIR Command job was scheduled for this machine by the Pointer Job (a) job.

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Comments

Aug 24, 2009 01:56 PM

Love this idea and am looking to incorporate it into my workflow.

I am packaging an application that has a prereq of Microsoft Visual C++ 2005 Redistributable.  We have already packaged the Redistributable and have been using it (as a stand-alone job) in Production for quite some time.  In the new job I am creating, I have scripted a reg query to look in the HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall key for "Microsoft Visual C++ 2005 Redistributable."  If found, the job exits with a custom EXIT CODE of 100 (the Redistributable is installed).  If not found, the job exits with a custom EXIT CODE of 111 (the Redistributable is NOT installed).  In the Return Codes dialog box, I have selected the Microsoft Visual C++ 2005 Redistributable job to run if EXIT CODE 111 is returned.

Everything works swimmingly ... with one exception.  After the called Microsoft Visual C++ 2005 Redistributable job completes, I have to go into the Console, right-click the computer in the new job, and select Retry Task. 

I would prefer to have this job run from top to bottom without having to manually retry the tasks.  Any recommendations?

Mar 31, 2009 12:22 PM

I have been using something like this for about a year now.  This makes it so much easier to link jobs or to make jobs run in order.  The only thing I would suggest that is different is instead of setting it to hidden just tell it to run locally on the Deployment Server (on the same page).  This way it just schedules the job.  You can even uncheck the box to run while the client is connected so it will automatically just schedule the job as soon as this is run.

One note is that if you do this twice (2 jobs use this) it will run other jobs scheduled at the same time as the first one before running the second job unless the first job has 2 tasks.  This means if you have one main script that tells the computer to run all the jobs (lets say for Initial deployment) and one of the jobs has a pointer job in it, it will basically skip this job until all the other pointer tasks in the first script are run.

Mar 27, 2009 05:56 PM

We have been doing this for some time, it works out great.  We call then 'Jobs for Workgroups'. 
In DS 6.8 we didn't always get the desired results.  Some of our jobs depended that other software be installed and we would string them in order.  The 'workgroup'  would just go through and submit all the jobs. But if a preceding job failed the next job would just go.
They fixed this in 6.9, now it launches one at a time from the 'workgroup' job. If the launched job doesn't give a successful completed return code, the next job in the string will not launch, allowing you to fix the issue.  The unfortunate thing is that sometimes the launched job would fail on a last step.  For example a copy, if we just went ahead a just did it by hand, because it was the last step continue job was not an option.  Then the 'workgroup' job would never get a good return code.  But it is much better than 6.8.

Mar 27, 2009 04:59 PM


There are already a few enhancement request for these job shortcuts. I recommend everyone who likes this to sign up to these KBs so that the DS guys make these aliases/shortcuts actual console objects. This launching method is great, but in a large environment finding the job it points to is pretty tricky.  You have to actually execute the alias (shortcut) see what job is then executed and then you can find the location of the real job....

It would also be good to see at a glance what is a real job, and what is an alias...

Anyway, here are the Enhancement Request KBs... please sign up!

https://kb.altiris.com/display/1n/kb/article.asp?aid=38786

https://kb.altiris.com/display/1n/kb/article.asp?aid=46104

https://kb.altiris.com/display/1n/kb/article.asp?aid=43211

Nice write up, by the way.

Kind Regards,
Ian./

Related Entries and Links

No Related Resource entered.