Skip to content

IAdmRunScriptAction

The IAdmRunScriptAction interface represents the Run a program or PowerShell script action.

Inheritance: The IAdmRunScriptAction interface inherits from the IAdmAction interface.

Methods

  • Method

  • Description

  • CanRunAs()

  • Validates whether the specified user credentials can be used to run the script.

  • RunAs()

  • Sets the credentials to be used to run the script.

Properties

  • Property

  • Description

  • ScriptType

  • Gets or sets a value indicating whether the action runs a PowerShell script or executes a command line.

  • ScriptDescription

  • Gets or sets a short description of the script.

  • Script

  • Gets or sets the text of a PowerShell script to execute, or a command line to be run, depending on the value of the ScriptType property.

  • RunAsUsername

  • Gets the username of the user account that is used to execute the action.

  • PowerShellInstalled

  • Gets a value indicating whether Windows PowerShell is installed on the computer where the Adaxes service is running.

Details

CanRunAs()

Validates whether the specified user credentials can be used to run the script. If the credentials cannot be used, the method throws an exception.

void CanRunAs(String username, String password)

RunAs()

Sets the credentials to be used to run the script.

void RunAs(String username, String password)

Remarks

If both parameters are set to NULL, the script will be executed using the credentials of the Adaxes service account.


ScriptType

Gets or sets a value indicating whether the action runs a PowerShell script or executes a command line.


ScriptDescription

Gets or sets a short description of the script. The description will be displayed in the Execution Log of the operation that triggered execution of this action.

  • Type:
  • String
  • Access:
  • Read/Write

Script

Gets or sets the text of a PowerShell script to execute, or a command line to be run, depending on the value of the ScriptType property. You can use value references in the script text and the command line text. Before executing it, Adaxes will replace the value references with corresponding property values of the directory object on which the script is executed.

  • Type:
  • String
  • Access:
  • Read/Write

RunAsUsername

Gets the username of the user account that is used to execute the action.

  • Type:
  • String
  • Access:
  • Read-only

PowerShellInstalled

Gets a value indicating whether Windows PowerShell is installed on the computer where the Adaxes service is running.

  • Type:
  • Boolean
  • Access:
  • Read-only

Requirements

Minimum required version: 2010.2

See also