# CMS_AddComputerToStaticGroup

> Adds the specified unit to the one or more static groups.

Source: https://docs.capaone.com/capainstaller/vb-scripting-library/cms-functions/cms-addcomputertostaticgroup/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

### Description

Adds the specified unit to the one or more static groups

For Business Unit support click [Business Unit support](/capainstaller/vb-scripting-library/addendum/business-unit-support/)

### Syntax

**VBScript**

```vb
CMS_AddComputerToStaticGroup(sUnit, sGroup) as Boolean
```

**PowerShell**

```powershell
[bool] CMS_AddComputerToStaticGroup -group <string>
```

### Parameters

#### sUnit (String)

Unit name

#### sGroup (String)

Group name.

It is possible to state more groups by using comma (,) as delimiter

### Return value

**VBScript**

Boolean, TRUE if function completed successfully.

**PowerShell**

Boolean, TRUE if function completed successfully.

### Example

**VBScript**

```vb
If bStatus Then bStatus = CMS_AddComputerToStaticGroup(gsUnitName, "CapaInstaller")
If bStatus Then bStatus = CMS_AddComputerToStaticGroup(gsUnitName, "Zone1,Zone2")
```

**PowerShell**

```powershell
CMS_AddComputerToStaticGroup -group 'static1'
```

[Scripting Guidelines](/capainstaller/vb-scripting-library/scripting-guidelines/)

### Related functions

[CMS_RemoveComputerFromStaticGroup](/capainstaller/vb-scripting-library/cms-functions/cms-removecomputerfromstaticgroup/) [Constants](/capainstaller/vb-scripting-library/addendum/constants/) [Package Property](/capainstaller/vb-scripting-library/addendum/package-property/) [Variables](/capainstaller/vb-scripting-library/addendum/variables/) [Business Unit support](/capainstaller/vb-scripting-library/addendum/business-unit-support/)
