Computer - Lock

Declaration

<AMCOMPUTER ACTIVITY="lock" />

Related Topics   

Overview

Submits a request to lock the workstation display.

Practical usage

Commonly used as the final step in a task to lock the workstation to protect it from unauthorized use. It is common to use this activity to lock the workstation if the task is started when it is locked.

Parameters

No parameters.

Description

Error Causes

On Error

Example

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

The following sample task checks the AMTrigger.Locked dataset to determine if the workstation is locked when the task starts. If the computer is in a locked state, the task re-locks the workstation before completion.

Copy
<AMVARIABLE NAME="AMTrigger.WasLocked" ISPARAMETER="YES" VALUE="1"></AMVARIABLE>
<!-- Place these steps at the end of the task to make it re-lock if the task was started locked -->
<AMIF EXPRESSION="%AMTrigger.WasLocked% = 1"><AMLOCKWORKSTATION /></AMIF>
<AMCOMPUTER ACTIVITY="lock" />
<AMIF ACTIVITY="end" />