Action Status on Shutdown

A question from a BigFix beginner. I created a simple task for shutting down clients. I’ve tried both dos shutdown /s in an action script and Shutdown computer after action completes on the Post-Action tab. Both accomplish the objective but the status remains Running or Pending Restart. I presume this is because the client much check in to update the status and cannot do so because it’s powered down. Is there a way to structure a shutdown task so that the status reports completed?

It will show complete when it comes back up.

Yes, I’ve observed that. The Action Success Criteria in the task is …all lines of the action script have completed successfully. Since this is in fact true I wish the status was reported as Completed immediately and not at the next power-up.

Instead of wait, you can use the Run command, which will just throw the command and report the status as completed.

https://developer.bigfix.com/action-script/reference/execution/run.html

1 Like

Hi Ray,

By its very nature, BigFix is a ‘client-centric’ platform, which means that the information you get in the Console is based off what the clients themselves report back. If you issue an action that shuts down the client and it succeeds, it won’t be able to report back (or update its status) because it will be powered off.

As mentioned in a response above, when the computer is powered back on, it will report the status of the previous action (the shutdown) completed; however, this will only be so if it is powered back on during the time when the shutdown action is ‘open’. That is, if the action expires in its default timeframe of 48 hours, but the computer remains powered off for 3 days, by the time it comes back up the action will have expired and will no longer update its status even if the computer tries to report it.

I’ll take a suggestion made above and expand a bit on it (meant for Windows devices):

In your action script use the command:

run shutdown.exe /s /t 300.

Using the ‘run’ command will allow it to execute the line and complete the action without waiting for the shutdown. The delay will also give your endpoint enough time to post a report showing the action complete before it shuts down.

A couple of things to note:

Using this command will cause a notification to be displayed like the one below to any logged-on user:

shutdownmessage

Of course, you can use the command as “shutdown /p” to supress the notification, but then the computer will shutdown immediately with no timeout or warning. This may not give the client enough time to report its status and any logged on user will be caught off guard and may lose whatever they are working on so, I would be careful about using this option.

Using the command with the delay will allow the client to report to the console and you will get a ‘completed’ status before the machine actually shuts down.
shutdowncompleted

Lastly, bear in mind that if a logged on user sees the notification, they can issue a ‘shutdown /a’ command to abort the shutdown you issued). As such, you may want to play with the delay time so that you give your device time to report, but minimize the amount of time any user has to countermand your action.
shutdowncancelled

So, in the end it comes down to compromising. What’s more important to you? Getting a completed status or actually shutting down the computer when you issue the order?

Hope that helps.

Mike

2 Likes

Thank you for your comprehensive post. It makes sense to me and is consistent with everything I’ve seen while testing various scenarios. At this time I’m using a 60-second countdown and getting a Completed status.

1 Like