CMS_AddComputerToDepartmentGroup

Description

Adds a specified computer to the specified department group

It will be unlinked from current department group (if any), since a computer only can be in one department group

For Business Unit support click here

Syntax

CMS_AddComputerToDepartmentGroup(sUnit, sGroup) as Boolean

[bool]CMS_AddComputerToDepartmentGroup -group <string>

Parameters

sUnit (String)

Unit name

sGroup (String)

Group name

Return value

Boolean, TRUE if function completed successfully.

Boolean, TRUE if function completed successfully. 

Example

VBScript
If bStatus Then bStatus = CMS_AddComputerToDepartmentGroup(gsUnitName, "CapaInstaller")
PowerShell
If (CMS_AddComputerToDepartmentGroup -group 'CapaInstaller') { $cs.Job_WriteLog("Added", "Computer added to department group: 'CapaInstaller'") }

Scripting Guidelines

Related functions

CMS_RemoveComputerFromDepartmentGroup