Skip to content

CMS_AddComputerToDepartmentGroup

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, see Business Unit support

If the department group doesn’t exist, it’s created. If the computer is linked to a Business Unit, the department group in that Business Unit is used.

CMS_AddComputerToDepartmentGroup(sUnit, sGroup) as Boolean

Not used. The function always applies to the computer that runs the package. Pass gsUnitName. PowerShell doesn’t have this parameter.

Group name. To specify more than one group, separate the names with commas, for example "Zone1,Zone2".

Boolean. True if the request was processed by the CapaInstaller server. The function also returns True if the group can’t be found, so use CMS_GetGroupMembership if you need to confirm the membership.

If bStatus Then bStatus = CMS_AddComputerToDepartmentGroup(gsUnitName, "CapaInstaller")

Scripting Guidelines

CMS_RemoveComputerFromDepartmentGroup Constants Package Property Variables Business Unit support