Skip to main content

HelloID

Accounts (PowerShell v2 target systems)

The five account scripts are the most important part of a PowerShell V2 target system. Use the existing script templates as a starting point. Customize them to specify how target accounts are created & managed. HelloID executes these scripts during Enforcement.

2023-11-08_14-34-54.png

To get started, Customize an account script.

All account scripts share a similar structure:

  1. HelloID passes you input variables, including your Target mappings, inside $actionContext and $personContext.

  2. You use these objects & their fields in your Account scripts to make calls to the target system's API inside the if (-Not($actionContext.DryRun -eq $true)) { } block. This is where you create, enable, update, disable, or delete the target account, depending on which script it is.

  3. You pass the results of your work back to HelloID via $outputContext. This includes writing Audit logs.

The maximum execution time for each script is 30 seconds, at which time script execution is terminated.

To skip a particular lifecycle stage, see Skip an account lifecycle stage. A skipped stage performs no action when the associated entitlement is granted, with one exception: A skipped Account Create stage results in a failed grant. This is because an account reference ($actionContext.References.Account) is required for subsequent lifecycle stages.

Tip

If you need a fresh, unedited copy of a script template, Add a PowerShell v2 target system and copy-paste the relevant template into your existing system.