# Get unit last runtime

> Gets a unit's last agent run time.

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

## Description

Gets a unit's last agent run time.

## Syntax

GetUnitLastRuntime(Byval UnitName as String, Byval UnitType as String) as String

## Parameters

***UnitName (String)***

The name of the unit

***UnitType (String)***

Type of Unit

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

## Return value

String. The date in the format; 'dd-MM-yyyy hh.mm.ss', I.e. '11-10-2012 08:18:10'

## Example

**VBScript**

```vb
Set oCMS = CreateObject("CapaInstaller.SDK") 
wscript.echo oCMS.SetInstanceManagementPoint("1") 
wscript.echo oCMS.GetUnitLastRuntime("Klient","1") 
```
