CMS_AddUnitToBusinessUnit
Description
Section titled “Description”Adds the unit on which the script is executed to the specified Business Unit. UserJobs add user and ComputerJobs add the computer
The Business Unit must exist. It isn’t created automatically.
Syntax
Section titled “Syntax”CMS_AddUnitToBusinessUnit(sBusinessUnitName) as Boolean[bool]CMS_AddUnitToBusinessUnit -businessunitname <string>Parameters
Section titled “Parameters”sBusinessUnitName (String)
Section titled “sBusinessUnitName (String)”BusinessUnit name
Return value
Section titled “Return value”Boolean. True if the unit was linked to the Business Unit. False if the Business Unit doesn’t exist or the unit couldn’t be linked.
Example
Section titled “Example”If bStatus Then bStatus = CMS_AddUnitToBusinessUnit("CapaInstaller")if (CMS_AddUnitToBusinessUnit 'bu_verona') { $cs.Job_WriteLog("Added", "Unit added to the Verona Business unit")}Related functions
Section titled “Related functions”CMS_RemoveComputerFromDepartmentGroup Constants Package Property Variables Business Unit support