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


This function is used to add a new Exchange payload to the specified profile.


Public Function AddExchangePayloadToProfile
(profileId As Integer, 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 As Boolean, ByVal changelogComment As String) As Boolean


ProfileID (Integer)

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

AccountName (String)

Name for the Exchange ActiveSync/Web Services Account


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$


Optional. The password of the account


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.


Specifies the Exchange server host name (or IP address)


Specifies whether the Exchange server uses SSL for authentication.


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


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


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


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


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


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


Whether to synchronize email between the device and the server


Whether to synchronize calendar between the device and the server


Whether to synchronize contacts between the device and the server


Whether to synchronize tasks between the device and the server

ChangelogComment (String)

Comment you wish to be added to the changelog

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 sAccountName                : sAccountName = "tre"
Dim sDomainandUserName          : sDomainandUserName = ""
Dim sPassword                   : sPassword = "1234"
Dim sEmailAddress               : sEmailAddress = ""
Dim sExchangeActiveSyncHost     : sExchangeActiveSyncHost = ""
Dim bUseSSL                     : bUseSSL = True
Dim iPastDaysofMailtoSync       : iPastDaysofMailtoSync = 14
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 = "Added exchange with sdk"

Wscript.echo "Added Exchange payload: " & oCMS.AddExchangePayloadToProfile(iProfileId, sAccountName, sDomainandUserName, sPassword, sEmailAddress, sExchangeActiveSyncHost, bUseSSL, iPastDaysofMailtoSync, bAllowMove, bUseOnlyinMail, bUseSMIME, bAllowRecentAddressSyncing, sSyncinterval, bSyncEmail, bSyncCalendar, bSyncContacts, bSyncTasks, sChangelogComment)
  • No labels