Video Screencast Help

How to use local server time for a task

Created: 03 Apr 2013 • Updated: 03 Apr 2013 | 2 comments


I have the following problem:

I want to restart my machines with a special script. The machines should all start at 3 o'clock in the morning - but 3 o'clock local time not notification server time.

In the old version 6.x we read out the system time and create complex SQL queries to handle the issue. Is there no easy way to say run a task but use local time…?

Does Altiris know only one time zone?

Thx BR Torsten

Operating Systems:

Comments 2 CommentsJump to latest comment

The Gaffer's picture

Hi Torsten,

There may be a better way to do this, but one solution could be to write an automation policy which runs hourly or half-hourly and runs your task on devices identified by the query:

select ac._ResourceGuid
from Inv_AeX_AC_Identification ac inner join vComputerResource cr
on ac._ResourceGuid = cr.Guid and cr.IsManaged=1
where ABS(DATEDIFF(mi, CONVERT(time,'03:00:00'), CONVERT(time,DATEADD(mi,ac.[Timezone Bias],getutcdate())))) <5

This uses the timezone info from the Inv_Aex_AC_Identification table to calculate what the current difference between the local time on the machine and 03:00 in the morning. If this is less than 5 minutes, the guids of these machines is returned by the query.

You will need to add further conditions to limit the targets to those machines you want the script to run on.

John Doyle

SaschaH's picture

Put the Script into a task and the task into a Managed Delivery Policy, then schedule the compliance check at the time you want. It will use the agents time by default to start the task. You could also schedule to repeat it on specific times of the week or month that way. Easiest way for repeating tasks.

Bechtle – your strong IT partner. Today and tomorrow

If that seems to help, please "Mark as Solution"