Video Screencast Help

Need advice on Run Script from Task Server task.

Created: 24 Mar 2013 | 4 comments
Ashuter's picture

Hi guys,

I've been working on a toolkit for SMP health and self remediation for a while. I'm stuck on a few areas but one I'd love to be able to resolve soon is we come across situations where a client machine (or sometimes even a site server) will not accept tasks. Generally this is due to some of the DLLs being unregistered, but sometimes the service just needs a restart.

I have a deecnt check in place for machines that are online but the agent doesn't run a task, and can then put these into a filter. The problem I would have in running a script to fix these machines using Altiris is that the agent won't run the script. The other way would be to have the script run from the task server but unfortunately that actually runs the script ON the task server. Can anyone think of a method where I can get the task server's agent to run something against it's managed clients? I also tried to leverage psexec through the altiris agent but it doesn't seem to like that.

We put a fix for this (the unregistered DLLs) in group policy ages ago but I can't rely on people to reboot their machines nearly often enough, so I'd like additional remediation through SMP.

Operating Systems:

Comments 4 CommentsJump to latest comment

Alex Bizjajev's picture

Hi Ashuter,

I'm sorry to hear about your problems with the tasks, if it is possible to attach logs from the problematic task-server and client then it will be really appreciated.

As a workaround I may suggest to use Client Task Schedule Policy (it could be created on "Jobs and Tasks" page from right-click pop-up menu). You may wrap your script task into this policy with re-occurring schedule. Policy will be delivered to client bypassing the task-management infrastructure and you script should be able to run on the clients even if task-server is off-line.

The only problem is that the status of policy execution will not appear in the console if task-server is in non-functional state.

Thank you,


andykn101's picture

I've not tried it myself but could you use Real Time System Manager to run a WMI script?

Or jut run a WMI script on the remote PC using a Server script?

Authorised Symantec Consultant (ASC) with Endpoint Management Limited, an Authorised Symantec Delivery Provider based in the UK.

Connect Etiquette: Please "Mark as Solution" posts that fix your problem.

AngelD's picture

remote execution with WMI as andy mentioned above or just old fashion psexec command on remote computer should do it.

Douglas.Dunphy's picture

We're doing some powershell things using run script on task server tasks.  The key is to use the token replacement that's available within the task to execute commands on the task server for the client.

Here's a very simple command script task to show the capability:

1.  Create a new Run Script on Task Server task

2.  For this example, choose "command Script"

3.  Click advanced, and check the box to save script output with task status

4.  In the Script window, type Ping followed by a space

5.  type "computer" inside the "insert token" text box and click the down arrow.  Choose "Computer Name (COMPNAME)"  

6.  click "Insert Token"

Save the task and run it against a client computer.  You should get back something similar to this:

Script:  C:\Windows\system32>Ping <computer name redacted>
Pinging <Computername redacted> [IP Redacted] with 32 bytes of data:
Reply from <IP Redacted>: bytes=32 time=36ms TTL=117
Reply from <IP Redacted>: bytes=32 time=35ms TTL=117
Reply from <IP Redacted>: bytes=32 time=35ms TTL=117
Reply from <IP Redacted>: bytes=32 time=35ms TTL=117
Ping statistics for <IP Redacted>:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 35ms, Maximum = 36ms, Average = 35ms

There are a bunch of tokens available; you can explore and find the tokens that best fit.  Hope this helps.