Task to lock computer for 24 hours

Hi Bigfixers,
I’m trying to create a simple task that locks a computer for 24 hours.

i tried this:
action lock until "{now + (24 * hours)}" on "{parameter "action issue date" of action}" for client
and got the error

Command failed (Relevance substitution failed) action lock until “{now + (24 * hours)}” on “{parameter “action issue date” of action}” for client

Later i would want to create the same command with parameter for the lock duration, but i thought i would start small…
any pointers?

Thanks!

The syntax is

action lock until <expire-date> <effective-date>

so you have some excess baggage in your code

Try

action lock until "{now + (24 * hours)}" "{parameter "action issue date" of action}"

3 Likes

Here is the action script guide in case its of help

https://developer.bigfix.com/action-script/reference/client/action-lock-until.html#:~:text=This%20command%20locks%20the%20client,date%20must%20be%20time%20objects.

3 Likes

that did the trick, thanks!
continuing that thought, can i lock a computer for a custom amount of hours?

Yes - I created a task which has 2 hard set action choices (2 day, and 7 day lock)to allow it to be put into a baseline or part of multi action… and also have 2 prompted options to support the adhoc lock for X hours, and lock for X days.

Example of Prompted hours:

// Lock for hours

action parameter query “_hours_wait” with description “Lock the system for how many hours [hh]”

action lock until “{now + (parameter “_hours_wait” as integer) * hour}” “{parameter “action issue date” of action}” for client

2 Likes

this is a great idea!
I took your idea and created a 4 action task:

  • action to lock for 24 hours
  • action to lock for 7 days
  • action to lock with custom time (hours)
  • action to lock indefinitely

all tested and working great, ill upload the BES task.

Thanks for your help!

1 Like