Stop-UserLockComputer

Stops a computer through the UserLock server.

Published May 31, 2025

Synopsis

Stops a computer through the UserLock server.

Syntax

powershell
Stop-UserLockComputer [-Name] <string[]> [-ExecutionMode <ExecutionMode>] [-NotifyMode <NotifyMode>] [-TimeOut <double>] [-ForceMode <ForceMode>] [-Message <string>] [-UserLockServerName <string>] [-PassThru] [-Force] [-Confirm] [-WhatIf][<CommonParameters>]

Stop-UserLockComputer [-InputObject] <MachineState[]> [-ExecutionMode <ExecutionMode>] [-NotifyMode <NotifyMode>] [-TimeOut <double>] [-ForceMode <ForceMode>] [-Message <string>] [-UserLockServerName <string>] [-PassThru] [-Force] [-Confirm] [-WhatIf][<CommonParameters>]

Description

The Stop-UserLockComputer cmdlet shuts down a computer through the UserLock server. This cmdlet lets user know, that the computer will be stopped, sending a pop-up with properties configurables by parameter. You can use Stop-UserLockComputer cmdlet only specifiying the computer(s) therefore the agent distribution properties will be taken charge to configure the pup-up. Caution: PowerShell 3.0 is required.

Parameters

-Name <string[]>

Specifies the name of the computer to shutdown. You can type multiple computer names (separated by commas). Wildcard characters are permited.

Required

true

Position

1

Accepts pipeline input

true (ByValue, ByPropertyName)

Accepts wildcard characters

true

-InputObject <MachineState[]>

Specifies the MachineState objects that represent the computers to shutdown. Enter a variable that contains the MachineState objects or a command that gets the MachineState objects, such as a Get-UserLockAgentDistribution command. You can also pipe the objects to Stop-UserLockComputer.

Required

true

Position

named

Accepts pipeline input

true (ByValue)

Accepts wildcard characters

false

-ExecutionMode <ExecutionMode>

Specifies the execution mode for the shutdown. Possible values for this parameter include: Default or -1 (Default execution mode configured in agent distribution properties) Immediate or 0 (Immediate execution) ImmediateIfPossible or 1 (Immediate execution if this is a workstation and no user has an open session. Otherwise a notification is displayed) AlwaysNotiFy or 2 (A notification is always displayed before executing the system action) The default execution mode is Default.

Required

false

Position

named

Accepts pipeline input

false

Accepts wildcard characters

false

Default Value

Default

-NotifyMode <NotifyMode>

Specifies the notify mode for the shutdown. Possible values for this parameter include: Default or -1 (Default execution mode configured in agent distribution properties) ExecuteAfterTimeout or 0 (Execute after displaying the notification during a specified time interval) PopupPeriod or 1 (Popup the notification again after a specified time interval. The action will be execute only when the user decide) The default notify mode is Default.

Required

false

Position

named

Accepts pipeline input

false

Accepts wildcard characters

false

Default Value

Default

-TimeOut <double>

Specifies the notification timeout in minutes.

Required

false

Position

named

Accepts pipeline input

false

Accepts wildcard characters

false

Default Value

1 minute

-ForceMode <ForceMode>

Specifies to force applications to close. Possible values for this parameter include: Default or -1 (Default force mode configured in agent distribution properties) No or 0 (Don't force applications to close) Yes or 1 (Force applications to close) The default force mode is Default.

Required

false

Position

named

Accepts pipeline input

false

Accepts wildcard characters

false

Default Value

Default

-Message <string>

Specifies the message of the popup. If the message includes escape characters, enclose it in single quotation marks. Single quotation marks tell Windows PowerShell not to interpret any characters as escape sequences. The alias for Message is msg.

Required

false

Position

named

Accepts pipeline input

false

Accepts wildcard characters

false

Default Value

'.'

-UserLockServerName <string>

Specifies the name of the UserLock server. The default is the localhost name.

Required

false

Position

named

Accepts pipeline input

false

Accepts wildcard characters

false

Default Value

'.'

-PassThru <SwitchParameter>

Returns the stopped computer object(s). By default, this cmdlet does not generate any output.

Required

false

Position

named

Accepts pipeline input

false

Accepts wildcard characters

false

-Force <SwitchParameter>

Stops computer(s) with no confirmation.

Required

false

Position

named

Accepts pipeline input

false

Accepts wildcard characters

false

-Confirm <SwitchParameter>

Prompts you for confirmation before executing the command.

Required

false

Position

named

Accepts pipeline input

false

Accepts wildcard characters

false

-WhatIf <SwitchParameter>

Describes what would happen if you executed the command without actually executing the command.

Required

false

Position

named

Accepts pipeline input

false

Accepts wildcard characters

false

<CommonParameters>

For more information about common parameters, type "Get-Help about_commonparameters".

Input Type

ISDecisions.UserLockLibrary.MachineState

Return Type

ISDecisions.UserLockLibrary.MachineState

Notes

You can also refer to Stop-UserLockComputer by its alias, "sulc". For more information, see about_Aliases. To use Stop-UserLockComputer, you must have the "Agent distribution" UserLock administrative access right.

Example

powershell
Stop-UserLockComputer Workstation1 -UserLockServerName MyUlSrv

Stops the computer called Workstation1 through the 'MyUlSrv' UserLock server.

Get-UserLockAgentDistribution

Restart-UserLockComputer

Start-UserLockComputer

Get-UserLockCommand