# Create unit

> Creates a unit linked to a management server, with optional status, uuid, serial number and device type.

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

## Description

Creates a unit.

## Syntax

CreateUnit(Byval UnitName as String, Byval UnitType as String, Byval LinkToManagementServerID as Integer, Optional Byval Status as String = "Active",Optional Byval Uuid as String = "") as Boolean

CreateUnit(ByVal unitName As String, ByVal unitType As String, ByVal linkToManagementServerID As Integer, Optional ByVal status As String = "Active", Optional ByVal uuid As String = "", Optional ByVal serialNumber As String = "", Optional unitDevicetype As String = "Unknown") As Boolean

## Parameters

***UnitName (String)***

The name of the unit

***UnitType (String)***

Type of Unit

- "Computer"
- "User"

***LinkToManagementServerID (Integer)***

The Management Server ID must match the ID of an existing management server. Computers with unitDevicetype Unknown/Windows will be linked to the management server. All units will be linked to the Management Point that the server is linked to.

***Status (String)***

Status for the new unit;

- "Active"
- "Inactive"

This is a optional parameter. The default value is; "Active"

***Uuid (String)***

Here you can enter the guid you want to be used as the unit's uuid.  
 It must be in the correct format: XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  
This is an optional parameter. If left blank, a uuid will be automatically generated.

***SerialNumber (String)***

Here you can enter the serial number of the unit.  
This is an optional parameter.

***Unit Device Type (String)***

Here you can add the specific platform wanted. Default is Unknown, that leaves the device to determine the platform

- Windows
- OSX
- iOS
- Android
- WindowsPhone

## Return value

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

## Example

**VBScript**

```vb
Set oCMS = CreateObject("CapaInstaller.SDK") 
wscript.echo oCMS.SetInstanceManagementPoint("1") 
Wscript.echo oCMS.CreateUnit("Client1","computer","1","Active") 
Wscript.echo oCMS.CreateUnit("iPhone20","computer","1","Active", "", "", "iOS")
```
