/build/static/layout/Breadcrumb_cap_w.png

Run Once Script

I can't quite find the exact answer to what I'm looking for, so I hope someone here can help.

I set up a new Offline KScript (Not even sure this is the correct one). I set it up to run on a group of laptops based on a peice of software that is installed, with a smart label.
Unfortunately, not all of the laptops have been into the office, and I expect some to not come in for up to 30 days. Which means they don't have the smart label assigned to their computer yet, and won't until they come back into the office and check-in with KACE.

This script needs to be run only once (Just a registry update), and I don't really care about success or failed messages, I just want it to run on all computers once with this software installed.

Can this be done with an Offline KScript?
By choosing the "Don't run on a schedule option", but by checking the "Also run a next client checkin" - is this only going to run on the computers that already have the smart label? Or will it "become aware" when a laptop checks in and picks up the new smart label?

Thanks in advance.

0 Comments   [ + ] Show comments

Answers (5)

Posted by: cblake 12 years ago
Red Belt
1
I often create my own tests to ensure that things don't run more than once as well. A bit more work I suppose, but foolproof.

Example:
Verify
Verify that registry value exists HKLM\SOFTWARE\CHRIS\My Custom Value

Success
Always Fail

Remediation
Run my action

Remediation Success
Write Registry value HKLM\SOFTWARE\CHRIS\My Custom Value

Remediation Failure
Log a message
Posted by: GillySpy 12 years ago
7th Degree Black Belt
0
If you do it as an offline kbot then the agent will have all the resources it needs to run the script at the appropriate time. The agent will also obey the local schedule. You can also specify it to run at check-in but again, even if the computers disconnect they will have what they need to run the script offline whenever the schedule comes up, so maybe it's only necessary to switch to offline and not necessary to add the check-in option. That's up to you.

Yes, when the machines check-in they will get their new label. next time they do a script update they will download the offline script they have been assigned. check your script update interval as well.

The biggest problem with offline scripts is that if you are coding in any interaction with the server -- e.g. uploading files or doing a manual inventory -- and you have a large group of machines that run it at the same time they will not be prevented by the server's (kbox) konductor (task scheduler). So it's a good rule-of-thumb not to target too big a group with offline kbots
Posted by: GillySpy 12 years ago
7th Degree Black Belt
0
+1 for you chris!
Posted by: baist111 12 years ago
Second Degree Blue Belt
0
If you do it as an offline kbot then the agent will have all the resources it needs to run the script at the appropriate time. The agent will also obey the local schedule. You can also specify it to run at check-in but again, even if the computers disconnect they will have what they need to run the script offline whenever the schedule comes up, so maybe it's only necessary to switch to offline and not necessary to add the check-in option. That's up to you.

Gilly, thanks for your reply - I'm confused by what you say here though... Mainly because I only want this script to run once, so there is not going to be any schedule, the Don't Run on a Schedule option will be checked. When I'm ready to run it, I'll hit the Run Now button, and it will run. What I'm unsure of, is this going to run for the computers that are disconnected?

I've only been using Patch schedules, so I'm trying to do something similar there. Create a patch schedule, assign a label to it, and run now +run on next connection if offline.

Does this make more sense.
Posted by: cblake 12 years ago
Red Belt
0
Offline scripts will run locally on a machine with or without a connection to the appliance, and they'll run next time the machine is on if it was off during the scheduled time. Of course the machine has to get the script from the appliance at some point though, so setting a singular schedule will ensure that it gets pushed to machines that are disconnected when you hit run now.

For patching a schedule is the option, with run at next availability if offline; patching DOES require an AMP connection, so it has to be able to talk to the appliance to run. Similar to an online script.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ