Use parameter values from a CSV file
When scheduling a Job, the option Use parameter values from file makes it possible to input Text parameter and Password parameter values from a CSV file, instead of providing these values manually. This makes it possible to feed information into Tasks from a spreadsheet. The same CSV file can be used for several Tasks, so that one spreadsheet can provide many different Tasks with parameter values. This makes it possible to input parameter values in bulk into large numbers of Tasks.
Each new school year, hundreds of new students enroll. For each new student, the administrator needs to run a Module that contains the Tasks Create Active Directory User and Manage Active Directory User. The Tasks are configured with Module parameters such as $[FullName], $[UserLogonName], $[CreateIn], $[passwd], etc. For each new student, the administrator needs to schedule the Module and provide the parameter values.
With the option Use parameter values from file, the Module no longer needs to be scheduled separately for each student. Instead, a CSV file refers to the relevant parameters and then provides the relevant information for each student.
FullName,UserLogonName,passwd, CreateIn
Amanda Cavendish,cavendisha,<password>,"OU=EngLit,OU=Students,OU=Campus1,DC=university,DC=local"
Dan Harris,harrisd,<password>,"OU=Maths,OU=Students,OU=Campus2,DC=university,DC=local"
Andrew Williams,williamsa,<password>,"OU=German,OU=Students,OU=Campus2,DC=university,DC=local"
Milosz Nowicki,nowickim,<password>,"OU=EngLit,OU=Students,OU=Campus1,DC=university,DC=local"
etc.
If the values in a column in the CSV file do not correspond with the desired values for a specific parameter, you can select a different column of values for a specific parameter by right clicking the parameter, selecting Select input column and choosing the relevant column.
Ivanti Automation will execute the Module once for each row in the CSV file. So, if the CSV contains 400 rows of user information, then Ivanti Automation will execute the Module 400 times and so create all 400 users - while the administrator only had to schedule the Module once.
Extra option for Run Books
When scheduling Run Books, additional options are available to choose how the parameter values from the CSV file should be used:
- Select Use on Task level to execute Tasks simultaneously. This is the fastest option. However, this results in more Tasks per Job. This means that if one Task fails, the entire Job fails.
- Select Use on Job level to spread out the Tasks over more Jobs, which are executed in turn. This results in fewer Tasks per Job, and is the safer option when the Error control on the job is configured to Continue Run Book on error: if one Job fails, Ivanti Automation will move on to the next Job. This option also provides more detailed information in the Job History. When the option Show jobs contained in Run Books is enabled, the separate jobs are shown in the Jobs Activity and Job History.
Suppose you have a CSV file with entries for user1 and user2. You also have a Run Book with 3 Run Book Jobs:
- Run Book Job 1 contains a Module Query Disk Space on a file server
- Run Book Job 2 contains a Module Create Active Directory user with parameters
- Run Book Job 3 contains a Project with 2 Modules that create a home folder on a file server and set permissions on this home folder. This Project contains parameters.
When you schedule the Run Book and specify the CSV file on the Job Parameters tab, choose how the parameter values from the CSV file should be used:
- On Task level
- On Job level
When the Run Book has been executed, the Job results will be:
On Task level: |
|
Job 1 |
|
Job 2 |
|
Job 3 |
|
On Job level: |
|
Job 1 |
|
Job 2 |
|
Job 3 |
|
Job 4 |
|
Job 5 |
|
The option Use parameter values from file makes it possible to use information obtained from third-party sources, such as change management systems. This is especially useful when scheduling Jobs unattended.
- The option Use parameter values from file can only be used for Text parameters and Password parameters. Other types of parameters cannot be filled with values imported from a CSV file. However, because parameters can be embedded, the values of a list parameter can be a set of text parameters, and those text parameters can be filled from a CSV file.
- Ivanti Automation only supports comma-separated CSV-files. Other formats, such as tab-separated or semi-colon separated are not supported.
- Empty rows in the CSV file are skipped.
- Use double quotes (") around parameter values that include comma's (such as the Active Directory paths used in the example above).
- When using this option, parameter values will be replaced by actual values: any link actions no longer apply as a result of this.
- In Run Books, it is not possible to use parameter values from a CSV file in conditions based on parameters whose values are based on other parameters.
- When selecting the option Use Run Book parameter, it is not possible to use parameter values from a CSV file for this parameter.