# Link profile to device

> Links a profile to a device.

Source: https://docs.capaone.com/capainstaller/sdk-capainstaller-software-development-kit-functions/mdm-functions/link-profile-to-device/  
Product: CapaInstaller — a separate CapaSystems product; do not apply this page to any other.

## Description

This function is used to link a profile to a device

## Syntax

**VBScript**

```vb
Public Function AddUnitToProfile(unitName As String, profileName As String, changelogComment As String) As Boolean
```

## Parameters

### **UnitName(String)**

The UnitName or UUID of the unit.

### **ProfileName(String)**

The name of the MDM Profile

### **ChangelogComment (String)**

*A comment that will be added to the changelog entry on the profile and the device*

## Return value

Returns a boolean value. True if succeeded, otherwise false.

## Example

**VBScript**

```vb
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")
```
