Uninstall-UserLockAgent

Uninstalls the UserLock agents in a computer through the UserLock server.

Published May 31, 2025

Synopsis

Uninstalls the UserLock agents in a computer through the UserLock server.

Syntax

powershell
Uninstall-UserLockAgent [-Name] <string[]> [-AgentType <AgentType[]>] [-UserLockServerName <string>] [-PassThru] [-Force] [-Confirm] [-WhatIf][<CommonParameters>]

Uninstall-UserLockAgent [-InputObject] <MachineState[]> [-AgentType <AgentType[]>] [-UserLockServerName <string>] [-PassThru] [-Force] [-Confirm] [-WhatIf][<CommonParameters>]

Description

The Uninstall-UserLockAgent cmdlet uninstalls the UserLock agents in a computer through the UserLock server. You can chose the type of the agent to uninstall, by default the cmdlet will uninstall all possible agents depending on the roles of the computer. UserLock agents like RRAS, IAS or IIS will be installed only in server machines with the same role. Caution: PowerShell 3.0 is required.

Parameters

-Name <string[]>

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

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 uninstall the agent. 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

-AgentType <AgentType[]>

Specifies the agent type to uninstall. You can type multiple computer names (separated by commas). Possible values for this parameter include: Desktop or 0 RRAS or 2 IAS or 3 IIS or 4 The default agent type is Desktop,RRAS,IAS,IIS. Type is an alias of the parameter. If IAS (NPS) is concerned, after the command ends, complete the uninstallation of the NPS Agent following the NPS Agent completing installation procedure here .

If IIS is concerned, after the command ends, complete the uninstallation of the IIS Agent following the procedure here.

Required

false

Position

named

Accepts pipeline input

false

Accepts wildcard characters

false

Default Value

Desktop,RRAS,IAS,IIS

-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 uninstalled 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>

Uninstalls agent on 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 or None

Notes

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

Example

powershell
Uninstall-UserLockAgent Workstation1 -UserLockServerName MyUlSrv

Uninstalls the Desktop UserLock agent in the computer called Workstation1 through the 'MyUlSrv' UserLock server.

Get-UserLockAgentDistribution

Start-UserLockComputer

Restart-UserLockComputer

Install-UserLockAgent

Get-UserLockCommand