Page tree
Skip to end of metadata
Go to start of metadata


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


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


ProfileID (Integer)

The ID of the profile you wish to add the exchange payload to

CurrentAccountName (String)

The account name of the exchange payload you wish to edit

AccountName (String)

Name for the Exchange ActiveSync/Web Services Account

DomainandUserName (String)

This string specifies the user name for this Exchange account. If missing, the devices prompts for it during profile installation. Format is  "<domain>\<username>"  e.g. "\$LoginName$"

Password (String)

Optional. The password of the account. Use only with encrypted profiles

EmailAddress (String)

Specifies the full email address for the account. The owners (primary user) email address must be injected upon delivery to the device.  If not present in the payload, the device prompts for this string during profile installation. In OS X, this key is required

ExchangeActiveSyncHost (String)

Specifies the Exchange server host name (or IP address). In OS X, this key is required

UseSSL (Boolean)

Specifies whether the Exchange server uses SSL for authentication

PastDaysofMailtoSync (Integer)

The number of past days of mail to syncronize. No limit = 0. Allowed values: 0,1,3,7,14,31

AllowMove (Boolean)

Optional. Default false. If set to true, messages may not be moved out of this email account into another account. Also prevents forwarding or replying from a different account than the message was originated from

UseOnlyinMail (Boolean)

Optional. Default false. If set to true, this account will not be available for sending mail in third party applications

UseSMIME (Boolean)

Optional. Default false. If set to true, this account supports S/MIME

AllowRecentAddressSyncing (Boolean)

If true, this account is excluded from address Recents syncing. This defaults to false

SyncInterval (Boolean)

How often the device will sync with the Exchange server. Allowed values: Automatic Push, Manually, 15 minutes, 30 minutes, 60 minutes

SyncEmail (Boolean)

Whether to synchronize calendar between the device and the server

SyncContacts (Boolean)

Whether to synchronize contacts between the device and the server

SyncTasks (Boolean)

Whether to synchronize tasks between the device and the server

ChangelogComment (String)

Comment to add to the changelog when calling this function

Return value

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


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

Dim iProfileId                  : iProfileId = 6
Dim sCurrentAccountName         : sCurrentAccountName = "tre"
Dim sAccountName                : sAccountName = "tree"
Dim sDomainandUserName          : sDomainandUserName = "\$LoginName$"
Dim sPassword                   : sPassword = "1234"
Dim sEmailAddress               : sEmailAddress = ""
Dim sExchangeActiveSyncHost     : sExchangeActiveSyncHost = ""
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)

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.

  • No labels