Edit Exchange Payload
Description
Section titled “Description”This function is used to Edit an existing Exchange payload in the specified profile. The payload is found by its account name. All settings of the payload are replaced by the values you specify.
Syntax
Section titled “Syntax”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 As Boolean, ByVal changelogComment As String) As BooleanParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
| profileId | Integer | The Id of the profile that contains the payload. Get it with Get Profiles. |
| currentAccountName | String | The current account name of the Exchange payload you want to edit. |
| AccountName | String | The new name of the Exchange ActiveSync account. It’s also used as the name of the payload. |
| DomainandUserName | String | The user name for the Exchange account, in the format domain\username, for example mydomain.com\$LoginName$. If it’s empty, the device prompts for it when the profile is installed. |
| Password | String | Optional. The password of the account. Only use it with encrypted profiles. Use an empty string to leave it out. |
| EmailAddress | String | The full email address for the account. If it’s empty, the device prompts for it when the profile is installed. Required for macOS. |
| ExchangeActiveSyncHost | String | The host name or IP address of the Exchange server. Required for macOS. |
| UseSSL | Boolean | True if the Exchange server uses SSL. |
| PastDaysofMailtoSync | Integer | The number of past days of mail to synchronize. Valid values: 0 (no limit), 1, 3, 7, 14, 31. |
| AllowMove | Boolean | If True, messages can’t be moved out of this account into another account, and the user can’t forward or reply from another account. |
| UseOnlyinMail | Boolean | If True, the account can’t be used to send mail from third-party apps. |
| UseSMIME | Boolean | If True, the account supports S/MIME. |
| AllowRecentAddressSyncing | Boolean | If True, the account is excluded from syncing of recent addresses. |
| Syncinterval | String | How often the device synchronizes with the Exchange server. Valid values: Automatic Push, Manually, 15 minutes, 30 minutes, 60 minutes. Any other value is treated as Automatic Push. |
| SyncEmail | Boolean | True to synchronize email. |
| SyncCalendar | Boolean | True to synchronize the calendar. |
| SyncContacts | Boolean | True to synchronize contacts. |
| SyncTasks | Boolean | True to synchronize tasks. |
| changelogComment | String | A comment that is added to the changelog entry of the profile. |
Return value
Section titled “Return value”Returns a boolean value. True if succeeded, false if not. The function returns false, and doesn’t change the profile, if no Exchange payload with the name in currentAccountName is found.
Example
Section titled “Example”Set oCMS = CreateObject("CapaInstaller.SDK")Wscript.echo oCMS.SetDatabaseSettings("ServerName", "Capainstaller", False)Wscript.echo oCMS.SetInstanceManagementPoint("2")
Dim iProfileId : iProfileId = 6Dim 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 = TrueDim iPastDaysofMailtoSync : iPastDaysofMailtoSync = 7Dim bAllowMove : bAllowMove = TrueDim bUseOnlyinMail : bUseOnlyinMail = FalseDim bUseSMIME : bUseSMIME = FalseDim bAllowRecentAddressSyncing : bAllowRecentAddressSyncing = TrueDim sSyncinterval : sSyncinterval = "30 minutes"Dim bSyncEmail : bSyncEmail = TrueDim bSyncCalendar : bSyncCalendar = TrueDim bSyncContacts : bSyncContacts = FalseDim bSyncTasks : bSyncTasks = FalseDim 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)