Pinned topic Power off device with reapply
Is it possible to run a "Power Off Computers" task that is re-run whenever it is relevant again? I've attached a screen shot of the take action window showing roughly how I'd like the action to apply.
Basically, I'd like to say that after a certain time of the day, lets say 5:10pm, if a device is still on, prompt the user and shut it down. Then, repeat the action each time it's relevant until 12:00am. Rinse and repeat every day.
The problem I have is that after the action runs the first time, it never runs again. The task is relevant for the device when it starts up, but to get it to shutdown again, a new action has to be created. I've tried creating the action without any time constraints, basically run whenever it's relevant but I still get the same result.
Can anyone maybe explain why this is experienced? Have I missed some vital logic?
SystemAdmin 110000D4XK562 Posts
Re: Power off device with reapply2013-03-16T02:54:00ZThis is the accepted answer. This is the accepted answer.Any clues in the client logs?
BTW: what happens if the user cancels the shutdown request? Will it try again later?
Re: Power off device with reapply2013-03-16T05:55:57ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
Unfortunately the logs don't really give much away. Prior to the action running, the logs indicate that the task is relevant.
At 23:15:33 +1000 - actionsite (http: //iem:52311/cgi-bin/bfgather.exe/actionsite) Relevant - Power off Computers (fixlet:2167)
Just before the device shuts down, there's an update.
At 23:21:09 +1000 - actionsite (http: //iem:52311/cgi-bin/bfgather.exe/actionsite) Not Relevant - Power off Computers (fixlet:2167)
After the device starts backup, there isn't anything related to the action logged.
I haven't yet tried cancelling the power off action to see what the result is. I'll give it a go and come back.
liuhoting 270004JWWE8 Posts
Re: Power off device with reapply2013-03-30T00:04:30ZThis is the accepted answer. This is the accepted answer.
- Michael_Knauth 060001R07N
I think what you have to do is make it toggle the applicability. You need to make it so that all of your relevance expressions are true the first time (in order to run the power off), false after it's immediately run (probably with some client setting or reg key with a current time parameter), then true some time afterwards (after some amount of time has passed based off that regkey we just set).
I think policy actions without that toggle will only run once.
Re: Power off device with reapply2013-03-31T13:07:46ZThis is the accepted answer. This is the accepted answer.
- liuhoting 270004JWWE
Yes, the task runs correctly the first time and never again, even though it's set up as a policy.
Being relatively new to IEM, and I'm not familiar with the concept of toggling applicability and the impact it has on policy-based tasks. I've not had to manipulate the applicability of a task before, and to a novice, just trying to read it isn't all that intuitive. I thought that for a client to just start up again would be enough to trigger the applicability.
Are you able to provide a brief example of what I might need to do, or provide a link that may assist?
AndreBordoniOliva 270005T1978 Posts
Re: Power off device with reapply2013-11-25T19:43:30ZThis is the accepted answer. This is the accepted answer.
- Michael_Knauth 060001R07N
Hi,Please could someone help me as to the Power Management site.Power Off the Script Computers he is successful, however after Reboot the machine it does not run again by disconnecting it again and showing the task as completed.Could you hand me a script that performs the action of Power Off Computers at a certain interval, forcing the shutdown even allowing not use the same.
SteveHull 2700043AHB3 Posts
Re: Power off device with reapply2013-11-25T22:30:29ZThis is the accepted answer. This is the accepted answer.
Set the reapply with a time delay. Instead of "whenever it becomes relevant again" choose the option "while relevant, waiting 15 minutes." This will allow the action to toggle relevance as liuhoting suggested. This occurs because your shutdown action is considered successful when all the steps are completed (was originally a task) rather than when the relevance evaluates to false (behavior for fixlets). So it never "becomes relevant again" because it is always relevant. The delay will simulate the concept of becoming relevant again and allow it to reapply.