IAdmRunScriptAction
The IAdmRunScriptAction interface represents the Run a program or PowerShell script action.
Inheritance: IAdmAction
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.
- Type:
- ADM_SCRIPTTYPE_ENUM
- Access:
- Read/Write
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:
- bool
- Access:
- Read-only
Requirements
Minimum required version: 2010.2