Using scripts you can automate tasks and improve productivity. Citrix Smart Tools enables you to create scripts with all the required script data. You can write your scripts directly during the script creation process or drag and drop pre-existing scripts from your local machine to the code editor. You can specify default values for script parameters. Values defined for parameters are saved and passed to the script at runtime.
You can create scripts to automate tasks including:
- Installing software
- Backing up servers
- Rotating logs
- Configuring infrastructure
- Monitoring resources
- Cleaning filesystems
- Managing users
Where are my scripts located?
All scripts and blueprints that you create are stored in your library. If you are a user of multiple Smart Tools accounts, you have a separate library for each account. For more information, see About the Library.
How do I add a script to my library?
Use the script editor to create a new script. From your library, simply click New Script. For more information, see Add a new script.
The script editor includes the following tabs:
- Script: Use this tab to enter your script in the code editor.
- Parameters: Use this tab to enter variables and values that need to be passed when the script is executed. You can also add tooltips to help blueprint users understand the intent of each parameter and input the right values, if applicable.
- Attachments: Use this tab to execute any companion files on the target server. For example, if a step in your blueprint requires that a ZIP utility be present on the target server, you can create an installation script and add the executable file as an attachment. You can then add the installation script as a step in your blueprint or deploy the script to the target server separately.
Which scripts does Smart Tools support?
Smart Tools does not execute the scripts you add to blueprints, so it does not need to support any specific script types. When you deploy a script through Smart Tools (typically as part of a larger blueprint), Smart Tools copies the script to the target server where it is executed. Therefore, the target server must have the correct script interpreter prior to deploying the script. Some interpreters are integrated into certain operating systems, so the interpreter for your script might reside already on the target server (for example, PowerShell or .NET on Windows servers). However, other interpreters might need to be installed, which might require an added step in your blueprint. Before deploying your script, verify the target server has the correct interpreter for executing your script successfully.
Can I test my scripts with Smart Tools?
No, you cannot test or "preview" your scripts from within Smart Tools. You can only add scripts using the script editor or deploy scripts. To validate your script and ensure it performs as expected, execute your script in a test environment that is similar to your target server prior to deploying with Smart Tools.
Note: Include appropriate error handlers in your script code for Smart Tools to interpret script failures. For example, you can program your script to exit with an error message in case of a script failure.
Can I share my scripts with other users?
Yes, you can share the scripts in your library with other users of your own Smart Tools account. However, you cannot share scripts with users of different Smart Tools accounts. For more information, see About sharing blueprints and scripts.