# Get custom inventory for unit

> Gets custom inventory for a specified unit.

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

## Description

Gets custom inventory for a specified unit.

## Syntax

This function is overloaded, meaning that two separate parameter sets are available;

### UnitName and UnitType

GetCustomInventoryForUnit(Byval UnitName as String, Byval UnitType as String) as ArrayList

### Uuid

GetCustomInventoryForUnitUUID(Byval Uuid as String) as ArrayList

## Parameters

*UnitName (String)*

The name of unit to get custom inventory for

*UnitType (String)*

The type of unit stated in UnitName. Two different values are accepted;

- "Computer"
- "User"

*Uuid (String)*

The uuid of unit to get custom inventory for in the format;  xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

## Return value

The function returns an array of custom inventory. Each element in the array is a joined line with the character defined with [Set splitter](/capainstaller/sdk-capainstaller-software-development-kit-functions/container-functions/set-splitter/).

- inv.Category
- inv.Entry
- inv.Value
- inv.Datatype
- inv.GUID
- inv.ID

## Example (UnitName and UnitType)

**VBScript**

```vb
Set oCMS = CreateObject("CapaInstaller.SDK")
Set aUnit = CreateObject("System.Collections.ArrayList")
wscript.echo oCMS.SetInstanceManagementPoint("1")
Set aUnit =  oCMS.GetCustomInventoryForUnit("Klient","User")
for each item in aUnit
  wscript.echo item
next
```

## Example (Uuid)

**VBScript**

```vb
Set oCMS = CreateObject("CapaInstaller.SDK")
Set aUnit = CreateObject("System.Collections.ArrayList")
wscript.echo oCMS.SetInstanceManagementPoint("1")
Set aUnit =  oCMS.GetCustomInventoryForUnitUUID("E3FBEC1E-32AC-4E51-AB9F-A644CD9F0A6B")
for each item in aUnit
  wscript.echo item
next
```
