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
- Install Okta AD agent version 3.23.0 or later on every active agent for the AD integration.
- Place a PowerShell script (
.ps1) at the same absolute file path on every server that runs an AD agent for this integration. Any connected agent can run an invocation. - Sign the script with an RSA-SHA256 signature in the format that the AD agent requires. See PowerShell script signing and key requirements for the AD agent.
- Have the matching RSA public key or certificate in a supported format. See PowerShell script signing and key requirements for the AD agent.
Procedure
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
PAYLOADenvironment 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.