Skip to content

IAdmScriptCondition

The IAdmScriptCondition interface represents the If PowerShell script returns true condition.

Inheritance: The IAdmScriptCondition interface inherits from the IAdmCondition 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

  • ScriptDescription

  • Gets or sets a short description of the script.

  • Script

  • Gets or sets the text of the PowerShell script that will be executed by the condition.

  • RunAsUsername

  • Gets the username of the account used to launch the script.

  • 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.


ScriptDescription

Gets or sets a short description of the script.

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

Script

Gets or sets the text of the PowerShell script that will be executed by the condition. You can use value references in the script text (e.g. %username%). Before executing the script, 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 account used to launch the script.

  • 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: 2012.1

See also