Link profile to device
Description
Section titled “Description”This function is used to link a profile to a device. The device then installs the profile.
Syntax
Section titled “Syntax”Public Function AddUnitToProfile(unitName As String, profileName As String, changelogComment As String) As BooleanParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| unitName | String | The name or UUID of the device. The device is found among computers (unit type Computer). |
| profileName | String | The name of the MDM Profile on the instance Management Point. |
| changelogComment | String | A comment that is added to the changelog entry on the profile and the device. |
Return value
Section titled “Return value”Returns a boolean value. True if succeeded. The function also returns true if the profile is already linked to the device. If the profile or the device isn’t found, the function raises an error.
Example
Section titled “Example”Set oCMS = CreateObject("CapaInstaller.SDK")Wscript.echo oCMS.SetDatabaseSettings("ServerName", "CapaInstaller", False)Wscript.echo oCMS.SetInstanceManagementPoint("2")
Wscript.echo oCMS.AddUnitToProfile("Testdev01", "Wi-Fi settings", "Added profile to device from SDK")Wscript.echo oCMS.AddUnitToProfile("4eea2959-fb4c-4afe-b61f-810cb3019cd6", "Wi-Fi settings", "Added profile to device from SDK")