Skip to content

Assign Profile to Business Unit

This function is used to assign an existing Profile to a Business Unit.

Public Function AssignProfileToBusinessUnit
(profileID As Integer, businessUnitName As String, changelogComment As String) As Boolean
Parameter Type Description
profileID Integer The Id of the profile. Get it with Get Profiles.
businessUnitName String The name of the Business Unit.
changelogComment String A comment that is added to the changelog entry of the profile.

Returns a boolean value. True if succeeded, false if not. The function also returns true if the profile is already assigned to the Business Unit. If the profile or the Business Unit isn’t found, the function raises an error.

Set oCMS = CreateObject("CapaInstaller.SDK")
oCMS.SetDatabaseSettings("ServerName", "CapaInstaller", False)
Wscript.echo oCMS.SetInstanceManagementPoint("2")
Wscript.echo oCMS.AssignProfileToBusinessUnit(28, "Skanderborg", "Added profile to BU from SDK")