1. Click Scripting > Scripts.
2. In the Choose Action menu, click Add New Item . The Script: Edit Detail page appears.
3. In the Configuration area, enter the requested details:
4. Specify the deployment options:
To perform these steps, be sure to select your organization in the Organization drop-down list in the top-right hand corner of the page.
Script Type Use this field to select the Offline Kscript or Online Kscript types.
Name (Optional) Enter a meaningful name for the script to make it easier to distinguish from others listed on the Scripts tab.
Description (Optional) Enter a brief description of the actions the script performs. This information helps you to distinguish one script from another on the Scripts tab.
Status Select a value to indicate whether the script is in development (Draft) or has been rolled out to your network (Production). Use the Template status if you are building a script that is used as the basis for future scripts.
Enabled Select to run the script on the target machines. Do not enable a script until you are finished editing and testing it and are ready to run it. Enable the script on a test label before you enable it on all machines.
Notes (Optional) Enter notes for yourself and other appliance administrators.
Deploy to All Machines
Select to deploy the script to all the machines.
Limit
Deployment To Selected Labels
Select a label to limit deployment only to machines grouped by that label. Press CTRL to select more than one label.
Limit
Deployment To Listed Machines
Select to limit deployment to one or more machines. From the drop-down list, select the machines to add to the list. You can filter the list by entering filter options.
Using the Scripting Features 9
Pick Specific OS Versions:
Select to limit the script to specific operating system versions. (Otherwise, the script runs on all versions of the operating systems you pick.)
Alerts:
Alert User Before Run Allows you to delay or cancel the script before it runs. (For example, choose to enable this for scripts that reboot or shut down computers.) If no user is logged in to the console, the script runs immediately.
Dialog Options:
• OK - The script runs immediately.
• Cancel - The script is cancelled until its next scheduled run.
• Snooze - The user is prompted again after the Snooze Duration.
If the time specified by Dialog Timeout elapses without the user pressing a button, the script runs at that time.
When the user presses the snooze button, the dialog reappears after the Snooze Duration.
Interaction With Run As:
• Only the console user can see the alert dialog (and therefore choose to snooze or cancel) regardless of the Run As setting.
• Enabling an alert prompts the console user even if the script is set to run as all users or another user.
Dialog Timeout (Minutes): Enter the number of minutes.
Snooze Duration (Minutes):
Enter the number of minutes:
Alert Message: Enter the message you want displayed to users.
Run As:
Online KScripts Only
Run As Local System Run with administrative privileges on local machine.
Use this setting for all scripts created with a wizard.
Run As User logged in to console
Affect that user’s profile.
Run As All Logged in Users Affect all users’ profiles.
Run As User: Handle network-wide tasks. Usually admin, but you can run as any user.
9 Using the Scripting Features
5. Click Run Now to immediately push the script to all machines. Use this option with caution. For more information about Run Now, refer to Using the Run Now function, on page 174.
Scheduling In the Scheduling area, specify when and how often the script is run.
Don’t Run on a Schedule Runs in combination with an event rather than on a specific date or at a specific time. Use this option in combination with one or more of the
“Also” choices below. For example, use this option in conjunction with “Also Run at User Login” to run whenever the user logs in.
Run Every nth minutes/
hours
Runs on every hour and minutes as specified.
Run Every day/specific day at HH:MM AM/PM
Runs on the specified time on the specified day.
Run on the nth of Every Month or on a Specific Month at HH:MM AM/PM.
Runs on a particular day of every month or particular month at a specified time.
Custom Schedule Allows you to set an arbitrary schedule using standard cron format. For example, 1,2,3,5,20-25,30-35,59 23 31 12 * * means:
On the last day of year, at 23:01, 23:02, 23:03, 23:05, 23:20, 23:21, 23:22, 23:23, 23:24, 23:25, 23:30, 23:31, 23:32, 23:33, 23:34, 23:35, 23:59.
The appliance does not support the extended cron format.
Also Run Once at next Client Checkin (Only for Offline KScript)
Runs the Offline KScript once when new scripts are downloaded from the appliance. To set the time interval for downloading scripts, click Scripting Update Interval in the help area on this page.
Also Run at Machine Boot Up (Only for Offline KScript)
Runs the Offline KScript at machine boot time.
Beware that this causes the machine to boot up slower than it might normally.
Also Run at User Login (Only for Offline KScript)
Runs the Offline KScript after the user has entered their Windows login credentials.
Allow Run While Disconnected (Only for Offline KScript)
Allows the Offline KScript to run even if the target machine cannot contact the appliance to report results. In such a case, results are stored on the machine and uploaded to the appliance until the next contact.
Allow Run While Logged Off (Only for Offline KScript)
Allows the Offline KScript to run even if a user is not logged in. To run the script only when the user is logged into the machine, clear this option.
Using the Scripting Features 9
6. To browse for and upload files required by the script, click Add new dependency, click Browse, and then click Open to add the new dependency file.
If a Replication Share is specified and enabled at Distribution > Replication, the dependencies are downloaded from the specified replication share.
Repeat this step to add additional new dependencies as necessary.
7. Click Add Task Section to add a new task.
The process flow of a task is a script similar to the following:
IF Verify THEN Success ELSE IF Remediation THEN
Remediation Success ELSE
Remediation Failure
8. Under Policy or Job Rules, set the following options for Task 1:
9. In the Verify section, click Add to add a step, and then select one or more steps to perform.
Refer to Appendix B: Adding Steps to Task Sections, starting on page 265.
10. In the On Success and Remediation sections, select one or more steps to perform.
Refer to Appendix A: Administering Mac OS Nodes, starting on page 259.
11. In the On Remediation Success and On Remediation Failure sections, select one or more steps to perform.
Refer to Appendix A: Administering Mac OS Nodes, starting on page 259.
If the replication share is inaccessible, the dependencies are downloaded from the appliance server.
To enable this setting, select the Failover To K1000 check box on the Replication Share : Edit Detail page.
Attempts Enter the number of times the script attempts to run.
If the script fails but remediation is successful, you may want to run the task again to confirm the remediation step. To do this, set the number of Attempts to 2 or more. If the Verify section fails, it is run the number of times mentioned in this field.
On Failure • Select Break to stop running upon failure.
• Select Continue to perform remediation steps upon failure.
To remove a dependency, task, or step, click the trash can icon beside the item. This icon appears when your mouse hovers over an item.