# Get groups on Business Unit

> Returns groups of the specified type on a business unit.

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

## Description

Returns groups of the specified type on a business unit

## Syntax

GetGroupsInBusinessUnit(ByVal businessUnit As String, Optional ByVal type As String = "") As ArrayList

## Parameters

**Business Unit (String)**

*Type (String)*

The type of group to retrieve.

- "Dynamic\_ADSI"
- "Calendar"
- "Department"
- "Dynamic\_SQL"
- "Reinstall"
- "Security"
- "Static"

The parameter is optional, meaning that it can be left out. This will cause all groups to be returned.

## Return value

An arraylist, containing all requested groups are returned. 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/). 

Each joined line (j) consists of these variables;

- j.Name
- j.Type
- j.unitType.ID
- j.Description
- j.GUID
- j.ID

## Example

**VBScript**

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