# Restart Agent using SDK

> Sets an action to restart an agent on a unit.

Source: https://docs.capaone.com/capainstaller/sdk-capainstaller-software-development-kit-functions/unit-functions/restart-agent-using-sdk/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

## Description

Sets an action to restart an agent.

## Syntax

RestartAgent(Byval UnitName as String, Byval UnitType as String) as Boolean

## Parameters

***UnitName (String)***

The name of the unit

***UnitType (String)***

Type of Unit

- "1" (Computer)
- "2" (User)

:::caution
*If a user is specified, the agent on the computers linked to the user will be restarted.*
:::

## Return value

Boolean. The function returns True if successful, otherwise false.

## Example

**VBScript**

```vb
Set oCMS = CreateObject("CapaInstaller.SDK") 
Wscript.echo oCMS.RestartAgent("Klient", "1")
```
