Skip to content

Remove profile from device

This function removes a profile from a device. The profile is marked for removal, and the device is told to remove the profile. When the device reports that the profile is removed, the link between the profile and the device is deleted. If you do not want to remove the profile from the physical device but only unlink the profile from the device, look at Unlink profile from device.

Public Function RemoveUnitFromProfile(unitName As String, profileName As String, changelogComment As String) As Boolean
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.

Returns a boolean value. True if succeeded. The function also returns true if the profile isn’t linked to the device. If the profile or the device isn’t found, the function raises an error.

Set oCMS = CreateObject("CapaInstaller.SDK")
Wscript.echo oCMS.SetDatabaseSettings("ServerName", "CapaInstaller", False)
Wscript.echo oCMS.SetInstanceManagementPoint("2")
Wscript.echo oCMS.RemoveUnitFromProfile("Testdev01", "Wi-Fi settings", "Removed profile from device from SDK")
Wscript.echo oCMS.RemoveUnitFromProfile("4eea2959-fb4c-4afe-b61f-810h31139cd6", "Wi-Fi settings", "Removed profile from device from SDK")