This HelloID Service Automation Powershell script generates a complete set of files including an "All-in-one Powershell script" for the provided delegated form.
Version | Description | Date |
---|---|---|
1.1.0 | Added support for new Delegated Form task using SA (cloud) Agent | 2022/02/20 |
1.0.2 | Fixed return empty array using PowerShell Core | 2021/11/2 |
1.0.1 | Added version number | 2021/10/27 |
1.0.0 | Initial release | 2021/01/08 |
After configuring and running the "generate-all-in-one.ps1" script the following outcome will be automaticly generated.
File | Description |
All-in-one setup\createform.ps1 | An All-in-one PS script to generate (import) the complete Delegated form and required resources into you HelloID portal using API calls |
Manual resources\[task]_<task-name>.ps1 | Powershell task connected to Delegated From |
Manual resources\[task]_<task-name>.config.json | PowerShell task config. Only for new Tasks using the SA (cloud) Agent |
Manual resources\[task]_<task-name>.mapping.json | Variable mapping of Powershell task connected to Delegated From. Only for old Autmation Tasks not using the SA (cloud) Agent |
Manual resources\dynamicform.jsom | JSON form structure of the Dynamic form |
Manual resources\[datasource]_<datasource-name>.json | JSON data structure used for Static data sources (only) |
Manual resources\[datasource]_<datasource-name>.ps1 | Powershell script from Task Data source or Powershell data source |
Manual resources\[datasource]_<datasource-name>.model.json | Data source model definition |
Manual resources\[datasource]_<datasource-name>.inputs.json | Data source input configuration |
The PowerShell script "generate-all-in-one.ps1" contains a complete PowerShell script using the HelloID API to create an all-in-one script and exporting manual resource files (see table above). Please follow the steps below in order to setup and run the "generate-all-in-one.ps1" PowerShell script in your own environment.
- Download the "generate-all-in-one.ps1" file
- Open it in your favorite PowerShell console/editor
- Create a HelloID API key and secret
- Update the connection and configuration details in the script's header
- Run the script on a machine with PowerShell support and an internet connection
Variable name | Example value | Description |
$script:PortalBaseUrl | https://customer01.helloid.com | Your HelloID portal's URL |
$apiKey | ***** | API Key value of your own environment |
$apiSecret | ***** | API secret value of your own environment |
$delegatedFormName | AD Account - Create | Name of the Delegated Form you want to export |
$useManualDelegatedFormCategories | $true | $true means use manual categories listed below. $false means receive current categories from DelegatedForm |
$manualDelegatedFormCategories | @("Active Directory", "User Management") | Array of Delegated Form categories to be connected to the newly generated Delegated Form. Only unique names are supported. Categories will be created if they don't exists |
$defaultDelegatedFormAccessGroupNames | @("Users", "HID_administrators") | Array of HelloID Group names to be connected as AccessGroups. Only unique names are supported. Group names have to exist. |
$debug | $false | Boolean value indicating debug mode. In Debug mode the HelloID resource names will get an suffix in order to "duplicate" the Delegated Form in the same environment (for testing) |
$debugSuffix | _tmp | Value of the name suffix that will be used for all HelloID resources in debug modus. |
$rootExportFolder | C:\HelloID\Delegated Forms | Local folder path for exporting files |
The generated all-in-one PowerShell script includes the following resources
- All used Global variables
- Based on variable name in used PowerShell scripts (Delegated Form task, Task data source and Powershell data source)
- The current value is used when the global variable is not configured as secret
- All used data sources with the Dynamic Form
- Internal buildin HelloID data sources (for example HelloID Groups)
- Static data sources (including JSON data structure and model definition)
- Task data sources (including Powershell Task, model definition and data source inputs)
- Powershell data sources (including Powershell script, model definition and data source inputs)
- All used Powershell scripts
- Delegated Form task (including variable mapping when using old Automation task)
- Task data source Powershell Task
- Powershell data source script
- Dynamic form JSON data structure
- The data source references in the JSON data structure are dynamicly updated to your own environment
- Configured Access Groups are assigned to the Delegated form
- Configured Categories are assigned to the Delegated form
- Manual configurated categories can be used or current categories connected to the referred Delegated Form
- Categories are created if they don't exist in the target HelloID environment
- Only global variables of type "string" are supported
- Only script variable mappings of type "string" are supported
- Powershel script template (use template instead of inline Powershell script) is not supported
- Delegate Form Access Groups are not exported but are hardcoded in the generated script (you need to update them manually)
If you need help, feel free to ask questions on our forum
The official HelloID documentation can be found at: https://docs.helloid.com/