Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Adds the unit on which the script is executed to the specified Business Unit. UserJobs add user and ComputerJobs add the computer

Syntax

(blue star) CMS_AddUnitToBusinessUnit(sBusinessUnitName) as Boolean 

(blue star) [bool]CMS_AddUnitToBusinessUnit -businessunitname <string>

Parameters

sBusinessUnitName (String)

BusinessUnit name


Return value

(blue star) Boolean, TRUE if function completed successfully.

(blue star) Boolean, TRUE if function completed successfully. 

Example

(blue star) VBScript
Eclipse
Code Block
theme
title
languagevbVBScript
If bStatus Then bStatus = CMS_AddUnitToBusinessUnit("CapaInstaller")
(blue star) PowerShell
Code Block
languagepowershell
if (CMS_AddUnitToBusinessUnit 'bu_verona') {
  $cs.Job_WriteLog("Added", "Unit added to the Verona Business unit")
}

Scripting Guidelines 

Related functions

CMS_RemoveComputerFromDepartmentGroup