# Add unit to group (BU)

> Adds a unit to a group in Global or a specified Business Unit.

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

## Description

Adds Unit to the specified group in either Global or the specified Business Unit.

## Syntax

AddUnitToGroupBU(Byval UnitName as String, Byval UnitType as String, Byval GroupName as String, Byval GroupType as String, ByVal businessUnitName As String) as Boolean

## Parameters

***UnitName (String)***

The name of the unit

***UnitType (String)***

Type of Unit

- "Computer"
- "User"
- "Printer"

***GroupName (String)***

The name of the group

***GroupType (String)***

The type of the group;

- "Calendar"
- "Department"
- "Reinstall"
- "Security"
- "Static"
- "Dynamic\_SQL" (Only Unittype=Printer)
- "Dynamic\_ADSI" (Only Unittype=Printer)

***BusinessUnitName (String)***

The name of the Business Unit where the group is located. If this is left blank, it is assumed the group is in Global. (If a Business Unit is specified, the unit must also be in that Business Unit)

## 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.AddUnitToGroupBU("Klient","computer","test","Static", "") 
Wscript.echo oCMS.AddUnitToGroupBU("Klient2","computer","test","Static","BusinessUnit1") 
```
