Enable and configure PowerShell script in Active Directory

Configure the Okta Active Directory agent to securely run a custom PowerShell script in your on-premises environment. Use this feature to execute custom lifecycle management (LCM) functionalities through PowerShell.

Before you begin

Procedure

  1. In the Admin Console, go to Directory > Directory Integrations.
  2. Select your Active Directory instance.
  3. Click the Provisioning tab, and then select PowerShell script in the Settings list.
  4. Select Enable PowerShell script execution.
  5. In PowerShell script file path, enter the absolute path of the signed script.
  6. Optional. Enter a Description for the script.
  7. In Public key, click Add files to upload the public key or certificate in a supported format.
  8. Click Save.
  9. Complete the authentication to verify your identity and save the configuration.

The script is configured and ready for invocation through Okta Workflows using the Okta public API. When the script is invoked:

  • The AD agent runs the script with Windows PowerShell, non-interactively, under the AD agent service account. The script has that account's permissions.
  • Windows execution policy isn't applied to this process. Okta's signature verification is the control.
  • The invocation payload is passed to the script as JSON text in the PAYLOAD environment variable.
  • A successful API response means the script started. It returns the process ID, not the script's result or output. Build logging into your script, and use the process ID to correlate with the System Log.