Exchange - Create session

Declaration

<AMEXCHANGE ACTIVITY="create_session" SESSION="text" PROTOCOLTYPE="text (options)" EMAILADDRESS="text"  USEHTTP="YES/NO" SERVER="text" AUTODISCOVERURL="YES/NO" IGNOREINVALIDCERTIFICATE="YES/NO" IMPERSONATE="YES/NO"  USERNAME="text" PASSWORD="text (encrypted)" DOMAINNAME="text" AUTHTYPE="text (options)"  TENANTID="text (encrypted)" CLIENTID="text (encrypted)" CLIENTSECRET="text (encrypted)" CURRENTFOLDER="text" TIMEOUT="number" PROXYTYPE="text (options)" PROXYSERVER="text" PROXYPORT="number" PROXYUSERNAME="text" PROXYPASSWORD="text (encrypted)" />

Related Topics   

Description

Creates a unique session to associate with subsequent Exchange steps, providing a single task the ability to execute numerous Exchange-related operations simultaneously.

Practical usage

Ideally used to create a session to correlate with subsequent Exchange activities. Numerous sessions can be created for a single task.   

Parameters

Server

Property Type Required Default Markup Description
Protocol Text (options) Yes EWS (Exchange 2007 & newer, Online)
  • PROTOCOLTYPE="ews2007"
  • PROTOCOLTYPE="webdav"
  • PROTOCOLTYPE="ewsonline"
Specifies the protocol to use to connect the Exchange server. The available options are:
  • WEBDAV (Exchange 2003, 2007) - Uses the Web Distributed Authoring and Provisioning (WEBDAV) protocol. Compatible with Microsoft Exchange Server 2003 and Exchange Server 2007.
  • EWS (Exchange 2007 & newer, Online) - Uses the Exchange Web Services (EWS) protocol. Compatible with Microsoft Exchange Server 2007 and newer versions, and Exchange Online.
  • EWS Online - Uses the EWS protocol to access Microsoft Exchange Online by way of Modern Authentication.
Session Text Yes ExchangeSession1 SESSION="NewSession" The name of the Exchange-based session to create. Several activities can be linked to a single session, eliminating redundant data entry and allowing tasks to be more organized. Numerous sessions can exist in a single task and run parallel with one another, increasing overall efficiency.
Email address Text Yes (Empty) EMAILADDRESS="test@netauto.com" A valid email address to use to authenticate the connection to the Exchange server.
Refer to these parameters when Protocol is set to WEBDAV (Exchange 2003, 2007).
HTTPS/HTTP Yes/No No HTTPS USEHTTP="YES" Indicates whether to use HTTP (normal HTTP) or HTTPS (secure HTTP) as the Exchange server protocol type.
Exchange server Text Yes (Empty) SERVER="server.domain.com" Specifies the address of the Exchange server.
Authentication type Text (options) Yes Basic
  • AUTHTYPE="Basic"
  • AUTHTYPE="Default"
  • AUTHTYPE="Form"
Specifies the type of authentication to use to connect to the Exchange server. This parameter is only available and required if the Protocol parameter is set to WEBDAV (Exchange 2003, 2007). The available options are:
  • Basic - Processes basic authentication credentials presented in HTTP headers.
  • Default - Uses the current Windows user's credentials to authenticate. Selecting this option disables the Domain name, Username, and Password parameters.
  • Form - Forms-based authentication lets you use an HTML form to obtain credentials from users who are attempting to access the Exchange server.
NOTE: If you are unsure of the option to use for this parameter, contact your network administrator
Domain name Text Yes (Empty)
  • DOMAINNAME="server.domain.com"
  • DOMAINNAME="xxx.xxx.xxx.xxx"
The domain name (for example, domain.exchangeServer.com) or IP address to use to connect to the Exchange server.
Username Text Yes (Empty) USERNAME="theUser" A valid username to use to authenticate the connection to the Exchange server. This value may or may not be identical to the value set in the Email address field.
Password Text Yes (Empty) PASSWORD="text (encrypted)" A valid password, corresponding to the Username parameter, to use to authenticate Exchange connection. This parameter is encrypted in Task Builder.
Refer to these parameters when Protocol is set to EWS (Exchange 2007 & newer, Online).
Username Text Yes (Empty) USERNAME="theUser" The username to use to authenticate the connection to the Exchange server. This value may or may not be identical to the value set in the Email address field.
Password Text Yes (Empty) PASSWORD="text (encrypted)" The password that corresponds with the Username parameter to use to authenticate Exchange connection. This parameter is encrypted in Task Builder.
Domain name (optional) Text No (Empty)
  • DOMAINNAME="server.domain.com"
  • DOMAINNAME="xxx.xxx.xxx.xxx"
The domain name (for example, domain.exchangeServer.com) or IP address to use to connect to the Exchange server. This parameter is only optional if the Protocol parameter is set to EWS (Exchange 2007 & newer, Online).
HTTPS/HTTP Yes/No No HTTPS USEHTTP="YES" Indicates whether to use HTTP (normal HTTP) or HTTPS (secure HTTP) as the Exchange server protocol type.
Exchange server Text Yes (Empty) SERVER="server.domain.com" Specifies the address of the Exchange server. Click Discover to automatically discover the server based on the email address and password entered.
Authenticate as current windows user --- No Disabled AUTHTYPE="default" If selected, authentication to the Exchange server is by way of the current Windows user's credentials, and the Username, Password and Domain name parameters are disabled. This parameter is disabled by default.
Rediscover server at runtime Yes/No No No AUTODISCOVERURL="YES" If selected, the Autodiscover service automatically performs at runtime (disabled by default). The Autodiscover service makes it easier to configure Outlook 2007 or newer, as well as some mobile phones, by using a user's email address and password to automatically configure a user's profile. Setting this parameter to YES disables the Exchange server parameter.
Refer to these parameters when Protocol is set to EWS Online.
Tenant ID Text Yes (Empty) TENANTID="text (encrypted)" The Directory (tenant) ID to use for authentication. This parameter is encrypted in Task Builder.
Client ID Text Yes (Empty) CLIENTID="text (encrypted)" The Application (client) ID to use for authentication. This parameter is encrypted in Task Builder.
Client secret Text Yes (Empty) CLIENTSECRET="text (encrypted)" The client secret Value to use for authentication. This parameter is encrypted in Task Builder.

Once the Email address, Tenant ID, Client ID, and Client secret parameters are populated, click Verify to perform a test connection to the Exchange Online server.

Advanced

Property Type Required Default Markup Description
Current folder Text Yes Calendar CURRENTFOLDER="Contact" The Exchange folder of where to perform this activity.
Timeout (seconds) Number No 100 TIMEOUT="120" The total amount of time in seconds that this activity is allowed to execute before a time out error occurs.
Impersonate Yes/No No No IMPERSONATE="YES" If selected, Exchange Impersonation is enabled (disabled by default). Impersonation enables a caller to impersonate a given account so that the operations are performed under the rights of the impersonated account, instead of the rights that are associated with the caller's account. This parameter is only available if the Protocol parameter is set to EWS (Exchange 2007 & newer, Online). The default setting for this parameter is NO.
Ignore invalid server certificate Yes/No No No IGNOREINVALIDCERTIFICATE="YES" If selected, invalid server certificates are ignored. In some cases, the SSL certificate may be expired or invalid and an exception is thrown due to its validity status. You can avoid such SSL certificate errors by selecting this parameter. This parameter is only available if the Protocol parameter is set to EWS (Exchange 2007 & newer, Online). The default setting for this parameter is NO.
Proxy type Text (options) No System default
  • PROXYTYPE="none"
  • PROXYTYPE="http"
Specifies the proxy type for Automate Desktop to use when attempting network communications through a proxy server. The available options are:
  • System default - Uses the default configurations set for Proxy in the Default Properties section of the Task Administrator (Options > Default Properties > Proxy).
  • None - No proxy is required.
  • HTTP - The proxy type is HTTP.
NOTE: If you are unsure of the value to use in this parameter, contact your network administrator.
Proxy server Text Yes, if Proxy type is set to HTTP (Empty)
  • PROXYSERVER="proxy.host.com"
  • PROXYSERVER="xxx.xxx.xxx.xxx"
The hostname (server.domain.com) or IP address of the proxy server. This parameter is only available and required if the Proxy type parameter is set to HTTP.
Proxy port Number Yes, if Proxy type is set to HTTP 1028 PROXYPORT="3000" The proxy port number to use to connect to the proxy server. Most proxy servers operate on port 1028 ( default), however, a proxy server can operate on other ports. This parameter is only available and required if the Proxy type parameter is set to HTTP.
Proxy username (optional) Text No (Empty) PROXYUSERNAME="username" The username to use to authenticate when connecting through the proxy server. This parameter is only available if the Proxy type parameter is set to HTTP.
Proxy password (optional) Text No (Empty) PROXYPASSWORD="text (encrypted)" The password that corresponds with the username in the Proxy username parameter. This parameter is encrypted in Task Builder. This parameter is only available if the Proxy type parameter is set to HTTP.

Description

Error Causes

On Error

Example

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

This sample task creates an Exchange session and includes a few Exchange - Create object steps to create a meeting and task. The task ends with an Exchange - End session step.

Copy
<!-- Create Variables -->
<AMVARIABLE NAME="meetingObjectID" VALUE="" />
<AMVARIABLE NAME="taskObjectID" VALUE="" />
<!-- Create Exchange Session -->
<AMEXCHANGE ACTIVITY="create_session" SESSION="NetAutoExchange" PROTOCOLTYPE="webdav" EMAILADDRESS="exchange@netauto.com" SERVER="indra.netauto.com" USERNAME="netauto.exchange" PASSWORD="AM4IaUpiBW8p0jdVSjFibrJx0ilJ97MCLAjaME" DOMAINNAME="netauto" CURRENTFOLDER="Calendar" />
<!-- Create Meeting Request -->
<AMEXCHANGE SESSION="NetAutoExchange" RESULTVARIABLE="meetingObjectID"><PROPERTY NAME="Subject" VALUE="Phone System Demo" /><PROPERTY NAME="StartTime" VALUE="12/8/2020 3:26:41 PM" /><PROPERTY NAME="EndTime" VALUE="12/8/2020 4:26:43 PM" /><PROPERTY NAME="Body" VALUE="All the new Features" /><PROPERTY NAME="Location" VALUE="Batman's Office" /><PROPERTY NAME="BusyStatus" VALUE="Meeting" /><PROPERTY NAME="RequiredAttendees" VALUE="nl@netauto.com " /></AMEXCHANGE>
<!-- Create Task -->
<AMEXCHANGE SESSION="NetAutoExchange" EXCHANGEOBJECTTYPE="task" RESULTVARIABLE="TaskObjectID"><PROPERTY NAME="Subject" VALUE="BF2 Meeting" /><PROPERTY NAME="StartDate" VALUE="12/8/2020 4:00:00 PM" /><PROPERTY NAME="DueDate" VALUE="12/8/2020 5:00:00 PM" /><PROPERTY NAME="Body" VALUE="Discuss Improvements" /></AMEXCHANGE>
<!-- End Exchange Session -->
<AMEXCHANGE ACTIVITY="end_session" SESSION="NetAutoExchange" />