# Edit Exchange Payload

> Edits an existing Exchange payload in the specified profile.

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

## Description

This function is used to Edit an existing Exchange payload in the specified profile.

## Syntax

**VBScript**

```vb
Public Function EditExchangePayload
(profileId As Integer, currentAccountName As String, AccountName As String, DomainandUserName As String,
Password As String, EmailAddress As String, ExchangeActiveSyncHost As String, UseSSL As Boolean, PastDaysofMailtoSync As Integer,
AllowMove As Boolean, UseOnlyinMail As Boolean, UseSMIME As Boolean, AllowRecentAddressSyncing As Boolean, Syncinterval As String,
SyncEmail As Boolean, SyncCalendar As Boolean, SyncContacts As Boolean, SyncTasks AsBoolean, ByVal changelogComment As String) As Boolean
```

## Parameters

## Return value

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

## Example

**VBScript**

```vb
Set oCMS = CreateObject("CapaInstaller.SDK")
Wscript.echo oCMS.SetDatabaseSettings("ServerName", "Capainstaller", False)
Wscript.echo oCMS.SetInstanceManagementPoint("2")

Dim iProfileId                  : iProfileId = 6
Dim sCurrentAccountName         : sCurrentAccountName = "tre"
Dim sAccountName                : sAccountName = "tree"
Dim sDomainandUserName          : sDomainandUserName = "myco.com\$LoginName$"
Dim sPassword                   : sPassword = "1234"
Dim sEmailAddress               : sEmailAddress = "tre@myco.com"
Dim sExchangeActiveSyncHost     : sExchangeActiveSyncHost = "outlook.office365.com"
Dim bUseSSL                     : bUseSSL = True
Dim iPastDaysofMailtoSync       : iPastDaysofMailtoSync = 7
Dim bAllowMove                  : bAllowMove = True
Dim bUseOnlyinMail              : bUseOnlyinMail = False
Dim bUseSMIME                   : bUseSMIME = False
Dim bAllowRecentAddressSyncing  : bAllowRecentAddressSyncing = True
Dim sSyncinterval               : sSyncinterval = "30 minutes"
Dim bSyncEmail                  : bSyncEmail = True
Dim bSyncCalendar               : bSyncCalendar = True
Dim bSyncContacts               : bSyncContacts = False
Dim bSyncTasks                  : bSyncTasks = False
Dim sChangelogComment           : sChangelogComment = "Edited exchange with sdk"

Wscript.echo "Edited Exchange payload: " & oCMS.EditExchangePayload(iProfileId, sCurrentAccountName, sAccountName, sDomainandUserName, sPassword, sEmailAddress, sExchangeActiveSyncHost, bUseSSL, iPastDaysofMailtoSync, bAllowMove, bUseOnlyinMail, bUseSMIME, bAllowRecentAddressSyncing, sSyncinterval, bSyncEmail, bSyncCalendar, bSyncContacts, bSyncTasks, sChangelogComment)
```

:::note[Important]
Please note

 

If multiple Exchange payloads exists in the specified profile, with the same account name specified in 'CurrentAccountname', they will all be removed and replaced with one new Exchange payload with the specified settings.
:::
