Quantcast
Channel: Outlook dev blog
Viewing all 108 articles
Browse latest View live

Provisioning, Policies, Remote Wipe, and ABQ in Exchange ActiveSync

$
0
0

This post is part of an ongoing series that covers Microsoft Exchange ActiveSync for developers.

Microsoft Exchange ActiveSync policies are the primary tool by which IT administrators can manage devices that connect to Microsoft Exchange mailboxes. Administrators can create policy settings to manage security settings such as PIN length, data encryption, and so on. Policies define the terms by which a client can synchronize mailbox data. The provisioning process is a communication that occurs between the client and server that indicates whether the client can enforces the required policies.

In addition to policies, Microsoft Exchange Server 2010 introduces another tool for administrators, known as Allow/Block/Quarantine (ABQ). ABQ enables administrators to control which devices or families of devices can synchronize data with Exchange ActiveSync. Administrators can also use ABQ to block certain devices or all unknown devices from synchronizing data.

Both ABQ and policies help administrators control how and whether data is synchronized onto a device. Remote Wipe is another Exchange ActiveSync feature that is used to remove data from a device. This feature is important when, for example, individuals leave the company, or a device is lost or stolen.

If you are creating an enterprise-class Exchange ActiveSync client, it is important for you to understand and support provisioning and policies, ABQ, and remote wipe. This post provides the information you need to know about these features, in the following sections:

  • Provisioning
  • Policies
  • Remote wipe
  • ABQ

 

Note

 

The following information, covered in this blog post, is important for the Exchange ActiveSync Logo Program:

·        Device manufacturer and model information

·        Password-related policies

·        MaxInactivityTimeDeviceLock policy

·        MaxDevicePasswordFailedAttempts policy

·        Remote Wipe

 

For more information about the logo program, see Exchange ActiveSync Logo Program on Microsoft TechNet.

Provisioning

The client’s goal in provisioning is to obtain a policy key from the Exchange server. This policy key enables the client to synchronize with a mailbox. Provisioning involves the following steps:

  • The client sends information to the server to identify itself.
  • The server sends security policies to the client that the client must enforce.
  • The client indicates whether it is able to enforce the security policies.
  • If the policies are applied successfully, the client is given a policy key that it then submits with subsequent requests to synchronize the mailbox.

For a detailed description of this process, see [MS-ASPROV]: ActiveSync Provisioning Protocol Specification section 3.1.5.1.

The following figure shows the two-step provisioning process.

clip_image002

Figure 1: Two-step provisioning process

Provisioning step 1: policy exchange between client and server

The policy exchange process involves a client Provision command request and a server Provision command response.

Client provisioning request

In its first request to the Exchange server, the client sends a Provision command request, as shown in the following example.

POST /Microsoft-Server-ActiveSync?User=deviceuser&DeviceId=6F24CAD599A5BF1A690246B8C68FAE8D&DeviceType=PocketPC&Cmd=Provision HTTP/1.1

Accept-Language: en-us

MS-ASProtocolVersion: 14.0

Content-Type: application/vnd.ms-sync.wbxml

X-MS-PolicyKey: 0

User-Agent: ASOM

Host: EXCH-B-003

 

<?xml version="1.0" encoding="utf-8"?>

<Provision xmlns="Provision:" xmlns:settings="Settings:">

    <settings:DeviceInformation>

        <settings:Set>

            <settings:Model>… </settings:Model>

            <settings:IMEI>...</settings:IMEI>

            <settings:FriendlyName>...</settings:FriendlyName>

            <settings:OS>...</settings:OS>

            <settings:OSLanguage>...</settings:OSLanguage>

            <settings:PhoneNumber>...</settings:PhoneNumber>

            <settings:MobileOperator>...</settings:MobileOperator>

            <settings:UserAgent>...</settings:UserAgent>

        </settings:Set>

    </settings:DeviceInformation>

     <Policies>

          <Policy>

               <PolicyType>MS-EAS-Provisioning-WBXML</PolicyType>

          </Policy>

     </Policies>

</Provision>

The client Provision command request includes information contained within two parent elements:

  • settings:DeviceInformation element
  • Policies element

I will discuss the settings.DeviceInformation element in more detail in the "ABQ" section later in this post.

In the Policies element section, the client indicates in the PolicyType element the format of the policy information that the client wants the server to use. The client should always send the “MS-EAS-Provisioning-WBXML” value, as described in [MS-ASPROV] section 2.2.2.42.

Provisioning request for different Exchange ActiveSync protocol versions

The use of the settings:DeviceInformation element in the provisioning request varies based on the version of the Exchange ActiveSync protocol the client is using, as described in the following table.

 

Exchange ActiveSync protocol version

Provision command request

Exchange ActiveSync version 12.1

The client should not include a settings:DeviceInformation element because this element is not supported.

Exchange ActiveSync version 14.0

The settings:DeviceInformation element is optional.  However, in order to support ABQ, the client must submit the DeviceInformation element with the Provision command request or with a Settings command request, as described in [MS-ASCMD]: ActiveSync Command Reference Protocol Specification section 2.2.3.43.

Exchange ActiveSync version 14.1

The settings:DeviceInformation element is required. The settings:Set child element is also required and must contain the Model child element.

For more information about the differences between Exchange ActiveSync protocol versions in client provisioning requests, see [MS-ASPROV] section 6.

Server provisioning response

The following example shows a server response to a client provisioning request.

Note: The policies listed in this example do not represent all the possible policies that the server might send. For a complete list of policies, see [MS-ASPROV] section 2.2.2.

HTTP/1.1 200 OK

Connection: Keep-Alive

Content-Length: 1069

Date: Mon, 01 May 2006 20:15:15 GMT

Content-Type: application/vnd.ms-sync.wbxml

Server: Microsoft-IIS/6.0

X-Powered-By: ASP.NET

X-AspNet-Version: 2.0.50727

MS-Server-ActiveSync: 8.0

Cache-Control: private

 

<?xml version="1.0" encoding="utf-8"?>

<Provision xmlns:A0="AirSync:" xmlns:A1="POOMCONTACTS:" xmlns:A2="POOMMAIL:" xmlns:A3="AirNotify:" xmlns:A4="POOMCAL:" xmlns:A5="Move:" xmlns:A6="GetItemEstimate:" xmlns:A7="FolderHierarchy:" xmlns:A8="MeetingResponse:" xmlns:A9="POOMTASKS:" xmlns:A10="ResolveRecipients:" xmlns:A11="ValidateCert:" xmlns:A12="POOMCONTACTS2:" xmlns:A13="Ping:" xmlns:A15="Search:" xmlns:A16="Gal:" xmlns:A17="AirSyncBase:" xmlns:A18="Settings:" xmlns:A19="DocumentLibrary:" xmlns:A20="ItemOperations:" xmlns:A21="ComposeMail:" xmlns:A22="POOMMAIL2:" xmlns:A23="Notes:" xmlns:A24="RightsManagement:" xmlns="Provision:">

  <Status>1 Success</Status>

  <Policies>

    <Policy>

      <PolicyType>MS-EAS-Provisioning-WBXML</PolicyType>

      <Status>1 Success</Status>

      <PolicyKey>2488355417</PolicyKey>

      <Data>

        <eas-provisioningdoc>

          <DevicePasswordEnabled>1</DevicePasswordEnabled>

          <AlphanumericDevicePasswordRequired>0</AlphanumericDevicePasswordRequired>

          <PasswordRecoveryEnabled>0</PasswordRecoveryEnabled>

          <RequireStorageCardEncryption>0</RequireStorageCardEncryption>

          <AttachmentsEnabled>1</AttachmentsEnabled>

          <MinDevicePasswordLength>4</MinDevicePasswordLength>

          <MaxInactivityTimeDeviceLock>900</MaxInactivityTimeDeviceLock>

          <MaxDevicePasswordFailedAttempts>8</MaxDevicePasswordFailedAttempts>

          <MaxAttachmentSize/>

          <AllowSimpleDevicePassword>1</AllowSimpleDevicePassword>

          <DevicePasswordExpiration/>

          <DevicePasswordHistory>0</DevicePasswordHistory>

          <AllowStorageCard>1</AllowStorageCard>

          <AllowCamera>1</AllowCamera>

          <RequireDeviceEncryption>0</RequireDeviceEncryption>

          <AllowUnsignedApplications>1</AllowUnsignedApplications>

          <AllowUnsignedInstallationPackages>1</AllowUnsignedInstallationPackages>

          <MinDevicePasswordComplexCharacters>1</MinDevicePasswordComplexCharacters>

          <AllowWiFi>1</AllowWiFi>

          <AllowTextMessaging>1</AllowTextMessaging>

          <AllowPOPIMAPEmail>1</AllowPOPIMAPEmail>

          <AllowBluetooth>2</AllowBluetooth>

          <AllowIrDA>1</AllowIrDA>

          <RequireManualSyncWhenRoaming>0</RequireManualSyncWhenRoaming>

          <AllowDesktopSync>1</AllowDesktopSync>

          <MaxCalendarAgeFilter>0</MaxCalendarAgeFilter>

          <AllowHTMLEmail>1</AllowHTMLEmail>

          <MaxEmailAgeFilter>0</MaxEmailAgeFilter>

          <MaxEmailBodyTruncationSize>-1</MaxEmailBodyTruncationSize>

          <MaxEmailHTMLBodyTruncationSize>-1</MaxEmailHTMLBodyTruncationSize>

          <RequireSignedSMIMEMessages>0</RequireSignedSMIMEMessages>

          <RequireEncryptedSMIMEMessages>0</RequireEncryptedSMIMEMessages>

          <RequireSignedSMIMEAlgorithm>0</RequireSignedSMIMEAlgorithm>

          <RequireEncryptionSMIMEAlgorithm>0</RequireEncryptionSMIMEAlgorithm>

          <AllowSMIMEEncryptionAlgorithmNegotiation>2</AllowSMIMEEncryptionAlgorithmNegotiation>

          <AllowSMIMESoftCerts>1</AllowSMIMESoftCerts>

          <AllowBrowser>1</AllowBrowser>

          <AllowConsumerEmail>1</AllowConsumerEmail>

          <AllowRemoteDesktop>1</AllowRemoteDesktop>

          <AllowInternetSharing>1</AllowInternetSharing>

          <UnapprovedInROMApplicationList/>

          <ApprovedApplicationList/>

        </eas-provisioningdoc>

      </Data>

    </Policy>

  </Policies>

</Provision>

The response includes the following:

  • A PolicyKey element, which contains a policy key that the client should retain and submit to the server with its next request.
  • A Data element and its child elements, which contain the policy settings that the server requires the client to apply. For more information about individual policy settings, see "Policies" later in this blog post.

Notice that the response contains two Status elements. The first Status element is a child of the Provision element and indicates the general status of the Exchange server’s ability to process the client’s request. The following table lists the possible values for the first Status element.

 

Status element value

Meaning

Description

1

Success

The Policies element contains the information about the security policies.

2

Protocol error

The request was malformed.

3

General server error

A transient error occurred. The client should retry the request over a period of time.

The second Status element is a child of the Policy element and indicates whether the policy settings were applied correctly. The following table lists the possible values for the Status element.

 

Status element value

Meaning

Description

1

Success

The Data element contains the policy settings to apply.

2

No policy

The server doesn't have a policy. The device doesn't need to submit a second request; it can proceed to sync data.

3

Unknown policy type

The device sent an invalid value for the PolicyType element. The only valid value for the PolicyType element is “MS-EAS-Provisioning-WBXML”.

4

Policy data is corrupt

The policy data on the server is corrupt. The device should suggest that the user contact the administrator.

5

Policy key mismatch

The policy key sent in the last request does not match the key stored on the server. Either the device sent the wrong policy key or the policy changed on the server since the first response. The device should re-initiate the provisioning process from the beginning.

 

Provisioning step 2: client acknowledges and applies policies

At this point, the server relies on the client to apply the policies as requested. After applying the security policy settings, the client sends another Provision command request to the server to acknowledge the policies and indicate its ability to apply them on the device.

The following example shows the second Provision request that the client sends to the server.

POST /Microsoft-Server-ActiveSync?User=deviceuser&DeviceId=6F24CAD599A5BF1A690246B8C68FAE8D&DeviceType=PocketPC&Cmd=Provision HTTP/1.1

Accept-Language: en-us

MS-ASProtocolVersion: 14.0

Content-Type: application/vnd.ms-sync.wbxml

X-MS-PolicyKey: 1307199584

User-Agent: ASOM

Host: EXCH-B-003

 

<?xml version="1.0" encoding="utf-8"?>

<Provision xmlns="Provision:">

     <Policies>

          <Policy>

               <PolicyType>MS-EAS-Provisioning-WBXML</PolicyType>

 <PolicyKey>1307199584</PolicyKey>

               <Status>1</Status>

          </Policy>

     </Policies>

</Provision>

This request contains the policy key value that the server sent to the client in step 1. It also contains a Status element that indicates whether the client was able to apply the policy settings. The following table lists the possible values of the Status element.

 

Status element value

Meaning

Description

1

Success

The client was able to apply all the policy settings.

2

Partial success

The client was able to apply some of the policy settings but failed to apply others.

3

Failure

The client was not able to apply any of the policy settings.

4

Externally managed

The client was provisioned by a third party.

Note: If a Microsoft Exchange administrator sets the "Allow non-provisionable devices" option in the Exchange ActiveSync policy, the server will allow all clients to synchronize mailbox data regardless of whether the client asked for policy settings or applied them successfully. However, if the administrator chooses to disable the "Allow non-provisionable devices" option, only clients that respond with "Success" are allowed to connect to the mailbox.

Important:   When the client indicates "partial success" in its second request to the server, this means that the client failed to apply at least one of the security policies that the server returned in its initial response. Note, however, that there is a distinction between policies that are not relevant to the device and policies that the device was not able to apply. The policies that “allow” and “disallow” certain features of the device do not have to be applied if they are not relevant to the device in order for the client to indicate "success" in its request. For example, if the device does not support Bluetooth, the client can safely ignore the AllowBluetooth policy and report back “success” instead of “partial success”. Conversely, if AllowBluetooth is set to false and the device supports Bluetooth but cannot disable it, the device can return “partial success”.

For any policy that requires a certain feature, the client must not return success if the policy cannot be applied. For example, the client should only indicate "success" for the RequireDeviceEncryption policy when the client supports device encryption. If the device doesn’t support encryption, the client should indicate "partial success" or "failure", depending on the status of the other policies. For more information about specific policies, see "Policies" later in this blog post.

Note: If the DevicePasswordEnabled policy is set to true, and the device is not able to enforce the password, it must return "failure" in response to the Provision command, regardless of whether it can enforce any other policy. The client can return "partial success" if it cannot enforce any other policies. For example, if the client enabled a password but failed to encrypt the device, it can return "partial success" rather than "failure".

The following example shows the server's response to the second client Provision request.

HTTP/1.1 200 OK

Connection: Keep-Alive

Content-Length: 63

Date: Mon, 01 May 2006 20:15:17 GMT

Content-Type: application/vnd.ms-sync.wbxml

Server: Microsoft-IIS/6.0

X-Powered-By: ASP.NET

X-AspNet-Version: 2.0.50727

MS-Server-ActiveSync: 8.0

Cache-Control: private

 

<?xml version="1.0" encoding="utf-8"?>

<Provision xmlns="Provision:">

     <Status>1</Status>

     <Policies>

          <Policy>

               <PolicyType> MS-EAS-Provisioning-WBXML </PolicyType>

               <Status>1</Status>

               <PolicyKey>3942919513</PolicyKey>

          </Policy>

     </Policies>

</Provision>

This response does not include a Data element that contains the list of policy settings. The server simply responds with a Status element (the values for which are listed in the "Server provisioning response" section) and a new policy key. This new policy key is the permanent key that the client should save and resubmit when it sends subsequent requests to the server.

Client handling of the policy key

The policy key represents the current security policy settings that are applied on the client. It can be up to 64 characters long and can contain any of the characters that are allowed in an HTTP header. The client should retain only the latest policy key that it has received from the server and submit it with all requests.

Note: Submitting the policy key is optional the Ping command and the HTTP OPTIONS commands.

The following example shows a client request that includes the policy key.

POST /Microsoft-Server-ActiveSync?User=deviceuser&DeviceId=6F24CAD599A5BF1A690246B8C68FAE8D&DeviceType=PocketPC&Cmd=FolderSync HTTP/1.1

Accept-Language: en-us

MS-ASProtocolVersion: 14.0

Content-Type: application/vnd.ms-sync.wbxml

X-MS-PolicyKey: 3942919513

User-Agent: ASOM

Host: EXCH-B-003

 

<?xml version="1.0" encoding="utf-8"?>

<FolderSync xmlns="FolderHierarchy:">

     <SyncKey>0</SyncKey>

</FolderSync>

When should a client provision?

Clients should send a Provision command request when they first contact the server. In some scenarios, the server may require the client to provision again, after an initial provision sequence. The server indicates this by sending a 449 HTTP error response or a success response with one of the status codes listed in the following table in response to any client request. The client should immediately send a Provision command request after receiving one of these statuses in a response.

 

Status code

Name

Description

139

DeviceNotFullyProvisionable

The device uses a protocol version that cannot send all the policy settings the administrator enabled.  The client should retry its request once per hour to determine whether the policy has changed. 

Important:   This is status code indicates a condition that will not be resolved until the administrator changes the policy. The client should display a warning that it cannot synchronize due to current policy settings and recommend that the user contact their administrator

140

RemoteWipeRequested

The server requests that the client wipe all data. The client should send a Provision command request so that it can acknowledge the wipe request.

141

LegacyDeviceOnStrictPolicy

The client is not capable of provisioning and the administrator has decided to make the policy a strict requirement. The client cannot synchronize until the policy changes. The client should retry once per hour to determine whether the policy has changed. 

Important:   This is status indicates a condition that will not be resolved until the administrator changes the policy.  The client should display a warning that it cannot synchronize due to current policy settings and recommend that the user contact their administrator. 

142

DeviceNotProvisioned

The client has not provisioned yet and must send a Provision command request immediately.

143

PolicyRefresh

The server is configured to send the policy to the client every n hours and it is now time for the client to receive the policy again, regardless of whether the policy has changed. The client has to resend the Provision command request to obtain a new policy key.

144

InvalidPolicyKey

The policy key sent by the client is no longer valid. This occurs when the policy is changed on the server (a new policy key is generated each time the policy changes). The client has to resend the Provision command request to get the new policy.

145

ExternallyManagedDevicesNotAllowed

The client indicated that it was provisioned through another mechanism but the server is configured to require that the client have the server's policy applied. The client should retry once per hour to determine whether the policy has changed. 

Important:   This status indicates a condition that will not be resolved until the administrator changes the policy.  The client should display a warning that it cannot synchronize due to current policy settings and recommend that the user contact their administrator. 

In version 12.1 of the Exchange ActiveSync protocol, the server only sends an HTTP 449 response to inform the client that it needs to provision; it does not send the status codes listed in the previous table. Because this error response does not enable the client to distinguish between transient and potentially nontransient provisioning errors, the client should try to provision. If subsequent requests fail with additional HTTP 449 error respon ses, the client should suggest that the user contact their administrator. At that point, the client may choose to try to provision once per hour to determine whether the policy has changed.

Important:   The client should compare existing device settings against policy updates to ensure that it is compliant with the updated policy. For example, if a password is set on the client, the client should compare the existing password (length, complexity, and so on) against the updated policy settings requested by the server. If the existing password does not conform to these updated policy settings or if the client cannot verify that the current password meets the requirements, the client should prompt the user to configure a new password.

Policies

Because it is up to the client to enforce policies, it is important to understand the effects that each policy will have on the device when applied. For a list of the elements that contain policy information, see [MS-ASPROV] section 2.2.2. This information will help you to determine acceptable values and expected results for each policy. For more information about policies in general, see Understanding Exchange ActiveSync Mailbox Policies on Microsoft TechNet.

This section lists and describes some of the policies that are available; it does not provide a comprehensive list of all policies. For more information about policies, see [MS-ASPROV].

The following table lists policies that clients can ignore and describes the conditions in which they can be ignored. If the conditions apply, the client can return "success" although the policy is not applied. Policies that are not listed in this table cannot be ignored under any conditions.

Policy name

Condition

AllowBluetooth

Ignored if the device does not support Bluetooth.

AllowCamera

Ignored if the device does not have a camera and a camera cannot be attached to the device.

AllowDesktopSync

Ignored if the device does not support connecting to a personal computer.

AllowInternetSharing

Ignored if the device does not support sharing its Internet connection with other devices.

AllowIrDA

Ignored if the device cannot transmit or receive infrared signals.

AllowRemoteDesktop

Ignored if the device does not support connecting remotely to a personal computer.

AllowStorageCard

Ignored if the device does not support storing data on removable storage.

AllowTextMessaging

Ignored if the device is not capable of using SMS messaging.

AllowWifi

Ignored if the device does not have Wi-Fi capability.

PasswordRecoveryEnabled

Ignored if the DevicePasswordEnabled element is set to FALSE (0) or if the client does not support recovery passwords.

RequireStorageCardEncryption

Ignored if the device does not support removable storage. If the device supports removable storage, it must reply to this policy request based on whether it is able to encrypt the storage card.

AllowSimpleDevicePassword,

AlphanumericDevicePasswordRequired,

DevicePasswordExpiration,

DevicePasswordHistory,

MinDevicePasswordComplexCharacters,

MaxDevicePasswordFailedAttempts,

MinDevicePasswordLength,

PasswordRecoveryEnabled

Ignored if the value of the DevicePasswordEnabled element is FALSE (0).

In addition, the MinDevicePasswordComplexCharacters policy can safely be ignored if the AlphanumericDevicePasswordRequired policy is set to false.

The following table lists additional policies and describes the expected behavior:

Policy name

Expected behavior

AllowSimpleDevicePassword

The server does not define a simple password. In general, simple passwords can include sequential digits (1234), repeating digits (1111), letters in keyboard order (qwerty), and so on.

AlphanumericDevicePasswordRequired

If the device can only enforce a numeric PIN, the client must fail to apply this policy if it is enabled.

DeviceEncryptionEnabled

The client should encrypt any data received from the server, including email messages, contacts, attachments, and so on. The client is not required to encrypt other data, such as photos or music.

DevicePasswordEnabled

If this policy is enabled, the client must require that the user enter a password before accessing any data obtained from the server, including email messages, contacts, attachments, and so on.

MaxDevicePasswordFailedAttempts

Specifies the number of consecutive attempts a user can make to enter the correct password for the device. After this number of attempts, the device must wipe all data obtained from the server. The device can (and should) implement a mechanism to prevent accidental button presses from causing a device wipe.

MaxEmailBodyTruncationSize

Specifies the maximum size at which to truncate email messages when synchronized to the client. The value is in kilobytes (KBs). The client must not allow the user to choose a value larger than this setting. This value does not restrict the size of items returned by the ItemOperations command. The device can download the full items.

MaxEmailHTMLBodyTruncationSize

Specifies the maximum size at which to truncate HTML email messages when synchronized to the client. The value is in KBs. The device must not allow the user to choose a value larger than this setting. This value does not restrict the size of items returned by the ItemOperations command. The device can download the full items.

MaxInactivityTimeDeviceLock

Specifies the length of time (in seconds) that the device can be inactive before the password is required to reactivate it. The user can choose a value that is smaller than this, but cannot choose a value that is larger.

PasswordRecoveryEnabled

A recovery password is a second password that can be used to unlock the device if the user forgets their original password. When the user enters the recovery password, the client should prompt the user to create a new password immediately. The client should then create a new recovery password and send it to the server by using the Settings command as soon as possible.

This is not technically a policy, because the client can still synchronize even if the device does not send a recovery password to the server. The purpose of this setting is to indicate to the client whether the server is willing to store a recovery password for the client. If the value for this policy is zero, the client should not send a recovery password to the server.

 

Remote Wipe

The remote wipe process enables administrators to request that the client erase all data from a device. Remote wipe is used in scenarios in which a device is lost or stolen or when a user has left the company or no longer has permission to synchronize corporate data. Administrators can use the Exchange Management Shell or the Exchange Management Console (EMC) to request a remote wipe. For more information, see Understanding Remote Device Wipe on Microsoft TechNet.

After an administrator requests a remote wipe, the next time the client sends a request to the server, the server will respond with status code 140, RemoteWipeRequested. The client should then submit a Provision command request. If the server's response contains a RemoteWipe element, the client should send an acknowledgement that it is about to wipe the device first. Because the wipe will erase all data from memory and storage, the client sends the acknowledgement first because it will not have the information it needs to send requests after it wipes the device. For examples of the requests and responses that are sent during the remote wipe process, see [MS-ASPROV] section 4.2.

Note:   In version 12.1 of the Exchange ActiveSync protocol, the server sends an HTTP 449 response instead of the 140 status code to request that the client send a Provision command to which the server will respond with a RemoteWipe element.

The following is an example of a server response to a Provision command request that includes a RemoteWipe element.

Content-Type: application/vnd.ms-sync.wbxml

Date: Wed, 25 Mar 2009 01:23:58 GMT

Content-Length: 14

 

<?xml version="1.0" encoding="utf-8"?>

<Provision>

<Status>1</Status>

<RemoteWipe />

</Provision>

The following example shows a Provision command request from the client that contains the remote wipe status.

POST /Microsoft-Server-ActiveSync?Cmd=Provision&User=T0SyncUser1v14.0&DeviceId=Device1&DeviceType=PocketPC HTTP/1.1

Content-Type: application/vnd.ms-sync.wbxml

MS-ASProtocolVersion: 14.0

X-MS-PolicyKey: 0

User-Agent: ASOM

Host: EXCH-B-003

 

<?xml version="1.0" encoding="utf-8"?>

<Provision xmlns="Provision:">

    <RemoteWipe>

        <Status>1</Status>

    </RemoteWipe>

</Provision>

The client should include one of the following values in the Status element:

  • 1 (Success) — Indicates that the client will wipe the device shortly after sending.
  • 2 (Failure) — Indicates that the client could not wipe the device.

 

Important:   Wiping the device resets the device to factory default conditions, including removing all data on the device and any data on the storage card if one is included.

 

ABQ

Allow/Block/Quarantine (ABQ) is a new feature introduced in Exchange 2010 that enables administrators to control device access to mailboxes based on device type. While provisioning and policies focus on managing device features such as passwords, cameras, encryption, and so on, ABQ simply controls access to the mailbox. Administrators use ABQ along with policies to manage Exchange ActiveSync clients. For more information, see Controlling Exchange ActiveSync device access using the Allow/Block/Quarantine list on the Exchange Team Blog.

Microsoft Exchange manages access to the mailbox through ABQ by using device information that it relies on the client to provide. The client sends this information in the Provision command request or as part of the Settings command, as shown in the following example.

<?xml version="1.0" encoding="utf-8"?>

<Settings xmlns="Settings:">

    <DeviceInformation>

        <Set>

            <Model>CONTOSO</Model>

            <IMEI>123456789012345</IMEI>

            <FriendlyName>Matt's Phone</FriendlyName>

            <OS>Contoso Phone1.0.1234</OS>

            <OSLanguage>English</OSLanguage>

            <PhoneNumber>555-555-1234</PhoneNumber>

            <MobileOperator>ContosoTelecom</MobileOperator>

            <UserAgent>ContosoPhone1</UserAgent>

            <EnableOutboundSMS>1</EnableOutboundSMS>

        </Set>

    </DeviceInformation>

</Settings>

The elements set by the client are listed in the following table:

Element name

Description

Model

Indicates the manufacturer and model name or number of the device.

FriendlyName

Describes the device in a way that is meaningful to a user.

IMEI

Uniquely identifies the device.

OS

Precisely specifies the operating system version that the client is running. The OS element value is structured as follows: <Operating System Name> <Operating System Major Version> <Operating System Minor Version>.

OSLanguage

Indicates the language used by the client. The server displays this information when it lists device properties.

PhoneNumber

Can be provided to help with troubleshooting or device management. This element is optional unless the EnableOutboundSMS element is set to 1, in which case the server returns a status code 5 because a phone number is required in order for the server to try to send SMS messages.

MobileOperator

Indicates the name of the operator that a mobile device is connected to.

UserAgent

The value of this element should match the User-Agent header values that are submitted with each request.

EnableOutboundSMS

This element should have a value of either 1 or 0 to indicate whether the client can be used to send outbound SMS messages composed by the server.

 

Note:   Clients that support versions 12.1 and 14.0 of the Exchange ActiveSync protocol should use the Settings command to send device information. The client should send the Settings command as soon as possible after provisioning and before sending the first FolderSync command.

 

Related Resources

[MS-ASCMD]: ActiveSync Command Reference Protocol Specification

[MS-ASPROV]: ActiveSync Provisioning Protocol Specification

Understanding Exchange ActiveSync Mailbox Policies

Understanding Remote Device Wipe

Controlling Exchange ActiveSync device access using the Allow/Block/Quarantine list

 

Post authored by: Matt Stehle, Microsoft Corporation


JET_ERRINFOBASIC_W API

$
0
0

The JET_ERRINFOBASIC_W API includes a group of constants, a structure, and a function, as defined in the header file Esent.h. These are described in this blog post.

Note: This documentation is based on a preliminary release of the Extensible Storage Engine. This information is subject to change.


JET_ERRCAT Constants

The JET_ERRCAT group of constants describes higher-level classifications or categories of errors. This group of constants enables applications to define default treatment for a classification of errors, rather than handling each error case individually. It also ensures that the application does not have to handle new error conditions that are included in existing classifications.

The JET_ERRCAT constants are arranged in a specific hierarchy of conditions and subconditions, as follows:

|--- Error
|--- Operation(al)
| |--- Fatal
| |--- IO
| |--- Resource
| |--- Memory
| |--- Quota
| |--- Disk
|
|--- Data
| |--- Corruption
| |--- Inconsistent
| |--- Fragmentation
|
|--- Api
|--- Usage
|--- State

The following table lists the JET_ERRCAT constants and provides a description and recovery information, as applicable.

Constant/value

Description

Recovery

JET_errcatUnknown
0

An invalid error category.

N/A.

JET_errcatError
1

The top level category (no errors should be of this class).

See the specific error constants.

JET_errcatOperation
2

Represents errors that can happen at any time due to uncontrollable conditions and are often temporary. See subcategories if specified

Retry and if the error continues, inform the operator.

JET_errcatFatal
3

Represents fatal errors that, when they occur, create a risk that ESE cannot continue in a safe (often transactional) way , and data may become corrupted.

Restart the instance or process. If the problem persists, inform the operator.

JET_errcatIO
4

Represents IO errors, which come from the operating system, and are out of ESE's control. This type of error may be temporary.

Retry, and if the error continues, ask the operator to check the disk.

JET_errcatResource
5

Represents a category of errors related to lack of resource conditions.

See subcategories.

JET_errcatMemory
6

Represents an error caused by lack of memory.

Retry after a period of time, free up memory, or quit.

JET_errcatQuota
7

Certain "specialty" resources are in pools of a certain size, making it easier to detect leaks of these resources.

The application should Assert() to detect these issues during development . However, in retail code , the application should treat this as a memory error.

JET_errcatDisk
8

Represents an error caused by lack of disk space.

Retry later to determine whether more disk space is available, or ask the operator to free some disk space.

JET_errcatData
9

Represents a top-level category for errors related to data.

See subcategories.

JET_errcatCorruption
10

Represents a corruption issue, which is often permanent without corrective action.

Restore from backup by using the ESE utilities repair operation (this operation restores only the data that is left/lossy). Also when the recovery(JetInit) method is used, recovery can be performed by allowing data loss (for more information, see JET_bitReplayIgnoreLostLogs.

JET_errcatInconsistent
11

Represents an error in which the database and/or log files are in a state that is inconsistent and cannot be reconciled. This error might be caused by application/administrator mishandling.

Restore from backup by using the ESE utilities repair operation (which only restores the data that is left/lossy). Also in the case of the recovery(JetInit) operation, recovery can be performed by allowing data loss (for more information, see JET_bitReplayIgnoreLostLogs.

JET_errcatFragmentation
12

Represents a class of errors in which some persisted internal resource ran out.

For database errors, offline defragmentation will fix the problem. For the log files, first recover all attached databases to a clean shutdown , and then delete all the log files and the checkpoint.

JET_errcatApi
13

See subcategories.

See subcategories.

JET_errcatUsage
14

Represents a usage error. The client code did not pass the correct arguments to the JET API. This error will persist with retry.

Client code should use the Assert() method to ensure that this class of errors is not returned. so issues can be caught during development. In retail , the application should notify the operator about the error.

JET_errcatState
15

Represents a class of messages that the API can return to describe the state of the database. For example, the JetSeek() method might return JET_errRecordNotFound when the requested record was not found.

Varies based on the API.

JET_errcatObsolete
16

Represents errors that are from a previous version of the engine. These errors should not be returned by the current engine.

Unknown.

JET_errcatMax
17

A constant that indicates the end of the enumeration.

N/A.

Requirements

Client

Requires Windows 8.

Server

Requires Windows 8 Server.

Header

Declared in Esent.h.


JET_ERRINFOBASIC_W Structure

The JET_ERRINFOBASIC_W structure defines the data that is returned from the JetGetErrorInfo() method when the JET_ErrorInfoSpecificErr InfoLevel [LG1] is passed in.

typedef struct {
         unsigned long    cbStruct;
         JET_ERR          errValue;
         JET_ERRCAT       errcatMostSpecific;
         unsigned char    rgCategoricalHierarchy[8];
         unsigned long    lSourceLine;
         WCHAR            rgszSourceFile[64];
} JET_ERRINFOBASIC_W;

Members

cbStruct
The size of the structure, in bytes. It must be set to sizeof( JET_ERRINFOBASIC ).

errValue
The error value that was evaluated, as passed in for the pvResult argument to JetGetErrorInfo().

errcatMostSpecific
The lowest-level JET_errcat constant that is associated with the error; that is, the leaf-level category in the category hierarchy documented in JET_ERRCAT.

rgCategoricalHierarchy[8]
The hierarchy of error categories that is associated with the error. Position 0 is the highest level in the hierarchy of JET_ERRCAT, and the rest are subcategories until the most specific category is set, after which all categories are JET_errcatUnknown.

lSourceLine
Reserved.

rgszSourceFile[64]
Reserved.

Requirements

Client

Requires 8.

Server

Requires 8 Server.

Header

Declared in Esent.h.


JetGetErrorInfoW Function

The JetGetErrorInfoW function BAS_ of the database engine.

JET_ERR JET_API JetGetErrorInfoW(
         _In_opt_ void *                    pvContext,
         _Out_writes_bytes_( cbMax ) void * pvResult,
         _In_ unsigned long                 cbMax,
         _In_ unsigned long                 InfoLevel,
         _In_ JET_GRBIT                     grbit );

Parameters

pvContext
The context or error value for which the extended error information is needed. The value passed in depends on the InfoLevel parameter value.

pvResult
A pointer to a buffer that will receive the information. The type of the buffer depends on the InfoLevel parameter value. The caller must be configured to align the buffer appropriately.

cbMax
The maximum size of the pvResult structure that is passed in.

InfoLevel
The type of information that will be retrieved for the error info/context is specified by the pvContext parameter. The format of the data that is stored in pvResult is dependent on InfoLevel.

The following table lists the possible values for this parameter.

Value

Meaning

JET_ErrorInfoSpecificErr

pvContext is interpreted as a JET_ERR/error code, pvResult is interpreted as a JET_ERRINFOBASIC_W, and the fields of the JET_ERRINFOBASIC_W structure are filled in appropriately.

grbit
Reserved.

Return Value

This function returns the JET_ERR data type with one of the return codes listed in the following table. For more information about the possible ESE errors, see Extensible Storage Engine Errors and Error Handling Parameters.

Return code

Description

JET_errSuccess

The operation completed successfully.

JET_errInvalidParameter

One of the parameters provided contains an unexpected value or contains a value that does not make sense when combined with the value of another parameter.

This can happen for JetGetErrorInfo when the following occurs:

  • The specified InfoLevel parameter value is invalid.
  • The specified grbit value is invalid.
  • The specified pvResult parameter buffer’s cbMax value is less than the required size for output of this InfoLevel parameter.
  • For InfoLevel = JET_ErrorInfoSpecificErr, the JET_ERR value passed in is unknown to the engine.

JET_errDisabledFunctionality

If this SKU of windows doesn’t support this function, this error will be returned.

On success, the output buffer that is appropriate for the requested error context/value will be set to the extended error info requested.

On failure, the state of the output buffers will be undefined.

Remarks

The JET_ERRINFOBASIC_W function and JET_ERRCAT group of constants contain documentation about the extended error information that is returned for InfoLevel = JET_ErrorInfoSpecificErr.

Requirements

Client

Requires Windows 8.

Server

Requires Windows 8 Server.

Header

Declared in Esent.h.

Library

Use ESENT.lib.

DLL

Requires ESENT.dll.

Unicode

Note: Only the JetGetErrorInfoW (Unicode) is implemented. This API does not have an A (ANSI) version.

Disabling EWS in Exchange 2010

$
0
0

Exchange Web Services (EWS) is a robust API that exposes many Exchange client access features. Many popular clients use this API on many different platforms. What if you want to limit client access via EWS, however? You do have an option. In Exchange 2010, you can use the Set-CASMailbox command to modify EWS access.

Note:   The Set-CASMailbox command in Exchange 2007 does not provide options for limiting EWS access.

The following options that the Set-CASMailbox command exposes enable you to change the settings on a per-user basis:

  • Turn EWS on/off
  • Turn EWS on/off for Outlook, Mac Outlook, and Entourage
  • Turn EWS on/off using allow/block lists for user agent filtering

These options make use of the user agent header to filter access. While useful in many scenarios, user agent filtering has one  inherent disadvantage: User agent strings can easily be written to represent agents on an allowed list, including Outlook, Mac Outlook, and Entourage. Of equal importance is the fact that specific EWS features can’t be blocked. EWS feature access is not segmented to allow access to particular EWS operations — it’s all or nothing. Turning off EWS will affect clients that use the OOF settings, availability, mail tips, and so on. It is important to take this into consideration when planning the client-server interaction part of your system architecture.

EWS Managed API 1.2 SDK – get ready, get set, plan

$
0
0

Are you ready? The EWS Managed API 1.2 documentation is now available, so let the preparation, planning, and architecting begin. The new EWS Managed API will have some updates that you may want to incorporate into your application. Take a look at the What’s New topic to learn more about the new content that is available to support the new EWS Managed API 1.2 functionality. Take a look at the Exchange Web Services Managed API 1.2 SDK topic to learn about the new EWS Managed API 1.2 functionality. 

Did you say “Where is the API download?” It’s coming soon. We are releasing the documentation earlier than usual so that you can get a jump on your planning for the next update of your EWS client application. So go have a feature review, maybe update your design specs, and get ready to implement your next update to your EWS client application.

New Exchange Interoperability Content on Open Specifications Developer Center

$
0
0

In November and December 2011, Exchange content made its debut on the Learn Open Specifications and Interoperability page in the Open Specifications Developer Center:

The updates include nine new Microsoft Exchange Learning Modules:

While you’re on the Learn tab exploring the new Exchange learning modules, don’t miss the Open Specifications Interactive Pivot, which also includes Exchange open specifications documents. We’re very excited about the Pivot, which makes it easy to find the open specifications documents you need in a visual, intuitive way. The Pivot uses Silverlight Deep zoom technology, which lets you visually search and filter the open specifications documents. Once you use it, you’ll see why we’re excited.

EWS item identifier and your database

$
0
0

Several times we’ve heard people ask what the maximum size is for the EWS identifier. This question usually comes up when developers are designing a database schema that will store the EWS identifier in a fixed-width column. Our answer is that the EWS item identifier should be contained in a fixed-width column of 512 characters. So, how confident should you feel about defining your field at 512 characters? Well, of course we reserve the right to change the format, and the resulting maximum length of the EWS identifier. The chances of that occurring, however, are very slim. The EWS identifier format has been changed once between Exchange 2007 and 2007 SP1, early on in the adoption of EWS, but we acknowledge that changing the format at this point would have unwelcome effects on both customer and Microsoft applications that interoperate with Exchange. In short, we do not expect the EWS identifier format to change.

Exchange Online EWSMaxSubscriptions throttling budget calculation has been updated!

$
0
0

We have made a change to the way that Exchange Online accounts for the number of subscriptions against the EWSMaxSubscriptions throttling limit.

In earlier versions of Exchange Online, the throttling limit was calculated against the calling account. A calling account, which can be one or many client applications or a service account targeting many mailboxes, was limited to 20 notification subscriptions. This subscription limit restricted Exchange Impersonation scenarios in which a service account accesses a large number of mailboxes. It limited a service account to at most access to 20 different mailboxes, assuming one subscription per mailbox, or 20 subscriptions on one mailbox. This was not very scalable. For example, if a service account had to access 5000 mailboxes, you had to have 250 service accounts to account for this limitation.

Starting with service mailbox versions 14.16.0135 and 14.15.0057.000, this limit has changed. Now, the charges are counted against the target mailbox rather than the calling account. This way, a service account can create subscriptions against many more than 20 mailboxes. One benefit of this change is that you can now design a service application that targets Exchange Online and Exchange on-premises using a similar code base for subscription management. A single service account can now service up to 5000 subscriptions.

Customers, you asked for this change, and now you have it. Subscribe on!  

More throttling changes for Exchange Online

$
0
0

In my last post, Exchange Online EWSMaxSubscriptions throttling budget calculation has been updated!, I wrote about a recent change to the EWSMaxSubscriptions throttling setting. Although useful, that information is just one part of the story. Now I’m here to fill you in on the rest.

We have made changes to the way that throttling budgets are counted for application impersonation calls. Now, the calls are charged against the target mailbox instead of the service account that makes the application impersonation calls. More specifically, the charges are counted against a copy of the target mailbox quota. This means that the impersonated service account access is not charged against the target mailbox account owner’s throttling budget. It is important to note that the copied budget is shared across all service accounts that are using application impersonation. This information is important when you are enabling many application impersonation scenarios against mailboxes. In summary, each throttling setting represents two budgets: one for the user account, and one for all service applications that use application impersonation against a specific user mailbox.

Here is a complete list of the throttling settings that have been updated with the new budget accounting:

  • EWSMaxConcurrency                    
  • EWSPercentTimeInAD                       
  • EWSPercentTimeInCAS                      
  • EWSPercentTimeInMailboxRPC     
  • EWSMaxSubscriptions                      
  • EWSFastSearchTimeoutInSeconds            
  • EWSFindCountLimit

I’d expect this to be welcome news. With that said, there is one exception to the change. The EWSMaxConcurrency setting limit does have some variation in how it is implemented for different types of connections. EWS streaming notifications have a separate budget from all other EWS client connections. For example, if EWSMaxConcurrency is set to the value of 10, it means that a user account (and all service applications using application impersonation) can have up 10 concurrent streaming notification subscriptions and 10 other concurrent EWS connections while targeting a single mailbox.

What does this mean for Exchange Online and streaming subscriptions? In short, this means that a service account can monitor up to 2000 mailboxes. Allow me to explain how this works. A service account application using application impersonation performs Subscribe operations using impersonation to set up subscriptions for each of the target mailboxes. Then, the service account application would bundle all the SubscriptionIds, up to 200 per GetStreamingEvents request, from all the mailboxes and include them in one GetStreamingEvents request. (NOTE: GetStreamingEvents and GetEvents operations do not have to use the impersonation header to get the notification events for the impersonated email messages. As long as the service account has a valid SubscriptionId, it can access the event notifications.) A service account can have at most 10 open GetStreamingEvents requests open at any one time. We recommend that there are no more than 200 SubscriptionIds in each GetStreamingEvents request. This effectively means that a single service account can monitor up to 2000 subscriptions, or 2000 mailboxes if you assume one subscription per mailbox. We expect that this should scale fairly well.

As with my last post, these changes have taken effect as of service mailbox versions 14.16.0135 and 14.15.0057.000 and later. These are customer-driven changes and we do appreciate the feedback. Code on!


Exchange Web Services Managed API 1.2.1 – now released!

$
0
0

The latest release of the EWS Managed API, version 1.2.1, is now available. The EWS Managed API 1.2.1 includes new Exchange Web Services (EWS) client logging features for Exchange Online as part of Office 365, as well as some minor bug fixes. You can download the EWS Managed API 1.2.1 from the Microsoft Download Center.

What’s new in the EWS Managed API 1.2.1

The EWS Managed API 1.2.1 includes new Exchange Online–specific functionality for logging client access and client latencies. This new functionality is implemented by means of two new HTTP headers: RequestId and X-ClientStatistics. Starting with the EWS Managed API 1.2.1, this functionality is enabled by default.  You can enable this functionality in previous versions of the EWS Managed API by accessing the HttpHeaders and HttpResponseHeaders collection on the ExchangeService object.

This change allows for the debugging of communication issues that occur between Exchange Online and the EWS Managed API. In fact, this functionality should be implemented by any EWS client that will be targeting Exchange Online.

The new RequestId header is returned in every response from EWS in versions of Exchange starting with Exchange Server 2010 SP2 RU2, and in Exchange Online. While this header is available for both an on-premise Exchange deployment and Exchange Online, it is particularly relevant for Exchange Online. The RequestId header contains a GUID value that uniquely identifies your request in the Office 365 server-side logs across all the Office 365 data centers. Essentially, you should log these requests with the client. If a support incident does occur, you can provide the RequestId to the Office 365 support engineers to help them identify issues related to request.

You can use the new X-ClientStatistics header to provide additional logging information for Exchange Online. You can enable additional performance logging for Exchange Online by providing the following information in your requests:

  • The RequestId received from a previous request
  • The client-logged roundtrip time between the request and response
  • The SOAP action

Note that the X-ClientStatistics header can be used to report data back to Office 365 at any time and that it can batch multiple latencies in a single header. This is another useful resource for Office 365 support engineers.

Important: The X-ClientStatistics functionality is not available for on-premise Exchange deployments.

The RequestId and X-ClientStatistics headers are both implemented in the EWS Managed API 1.2.1. The RequestId header is sent by Exchange with every response. You can disable the X-ClientStatistics functionality on the ExchangeService object by setting the new SendClientLatencies properties to false.

  If you are using Exchange Online but you are not using the EWS Managed API, we recommend that you capture and log the RequestId header and the send X-ClientStatistics header. The following are the header definitions: 
  • RequestId: <GUID>; where <GUID> is the unique request identifier.
  • X-ClientStatistics: MessageId=<RequestIdFromPreviousResponse>,ResponseTime=<EndToEndLatencyInMiliseconds>,SoapAction<operation>; where <RequestIdFromPreviousResponse> is a request identifier from a previous response, <EndToEndLatencyInMiliseconds> is the client-logged round trip time between when the request was submitted and when the response was received for the request-response identified by the RequestId, and <operation> identifies the SOAPAction header for the request identified by the RequestId header. If you are sending multiple client latency reports back to the server, you must separate the latencies with a semicolon.

The EWS Managed API 1.2.1 fixes two Autodiscover redirect issues for scenarios in which an Exchange Server 2013 Preview user targets a request to an Exchange 2010 server.

While not a large set of changes, they are still interesting. These updates will primarily help Office 365 support engineers help you if your application experiences issues communicating with the server. This should help make our service perform better, and your problems to be solved in a shorter amount of time.

New content for Exchange 2013 Preview

$
0
0

Now that Exchange Server 2013 Preview is available, here's a quick summary of what you'll find on MSDN to help you learn more about the latest new features. For a detailed look at what's new in Exchange 2013 Preview, see the Exchange Team Blog.

Developer roadmap for Exchange

We created a new Developer roadmap for Exchange that provides an overview of what's new in Exchange development, and is designed to help you determine the best way to develop your Exchange applications. It covers the technologies that are available in each version of Exchange and the evaluation criteria that you can use to select the right development technology for your application. If you're planning to migrate to Exchange 2013 Preview, you'll find information about migrating your applications from earlier versions of Exchange to the new version in the article Migrate from earlier technologies to Exchange 2013. Feel free to leave us a comment to let us know which migration scenarios are important to you.

Changes to the EWS APIs

Exchange Web Services (EWS) and the EWS Managed API have been updated to provide programmatic access to the new features in Exchange 2013 Preview. We’ve added documentation to support the following new features:

· eDiscovery — Enables you to preserve and discover data across your organization to ensure internal and regulatory compliance.

· Archiving — Enables you to move mail items from a primary mailbox to an archive mailbox for long-term storage.

· Retention policies — Enables you to group retention tags, apply retention settings to folders and individual items, and apply retention settings to a mailbox.

· Block senders and mark email as junk — Enables you to keep junk email messages out of users' Inboxes.

· Getting user photos — Gets the photo that is associated with an email account from an Exchange server by using a simple HTTP GET request.

· Personas (EWS only) — Enables you to link to, search for, and browse for information about a person from multiple sources.

· Unified Contact Store (EWS only) — Enables you to store, manage, and access contact information from any application.

For more information about these new features, see New features in the EWS Managed API and New features in EWS in Exchange 2013.

Mail apps for Outlook

One of the exciting new features of Microsoft Office 2013 Preview is apps for Office. Apps for Office enable you to extend the power of Office applications by using standard web technologies to create individual apps. Exchange server supports mail apps for Outlook and Outlook Web App to add contextual information to email messages and calendar appointments. For information about migrating from a customized Outlook Web App to mail apps for Outlook, see Migrate to mail apps for Outlook Web App customization. For information about how to create mail apps for Outlook and Outlook Web App, see Mail apps for Outlook. See also the new blog dedicated to apps for Office, the Apps for Office and SharePoint blog.

Exchange 2013 101 code samples

Want code samples? New for Exchange 2013 Preview is the Exchange 2013 101 code samples package, which includes code samples that will help you to develop Exchange 2013 Preview applications by using the EWS Managed API. The package currently includes 38 code samples, and we’ll add more. You can download them all, or you can select just the ones that you want and download them individually. For a list of all the code samples that are currently available, see EWS Managed API code samples.

Join the conversation

Finally, we invite you to take advantage of the Community feature to give us feedback on our Exchange 2013 Preview documentation. Let us know how we can improve our content to better meet your needs. We’ll also be updating the documentation periodically, so keep an eye out for new content announcements.

EWS Managed API 2.0 – now released!

$
0
0

The wait is over. If you have been working with the EWS Managed API 2.0 Technical Preview, you can now get the new 2.0 version and check out the latest updates. You can download the EWS Managed API 2.0 from the Microsoft Download Center.

What's new in the EWS Managed API 2.0

The EWS Managed API has been updated to support some of the latest features that are available in Exchange Web Services (EWS) in Exchange Server 2013, including the following:

  • eDiscovery
  • Archiving
  • Retention policies
  • Mail apps for Outlook

For more information about these features, see the article New features in the EWS Managed API.

In addition to these features, the EWS Managed API 2.0 introduces the ServerBusyException class. This class represents a server busy exception that can be found in a service response. You can use the BackOffMilliseconds property of this class to set the number of milliseconds to wait before the service attempts a request again, or you can set it to zero if there is no suggested back off time.

If you have been using the EWS Managed API 2.0 Technical Preview, you might have noticed a new requirement. The EWS Managed API 2.0 Technical Preview required the .NET Framework 4, which might not be compatible with applications that you wrote with earlier versions of the EWS Managed API. That requirement has been rolled back in the EWS Managed API 2.0, which requires the .NET Framework 3.5.

The EWS Managed API 2.0 download also includes the Exchange Server 2013 token validation library. You can use the EWS Managed API and the library to build mail apps for Outlook that can be authenticated by the identity tokens issued by Exchange 2013. For more information about the EWS Managed API 2.0 and the token validation library, see Authenticating a mail app by using Exchange 2013 identity tokens.

Don’t forget to check out our collection of code samples that will help you develop Exchange 2013 applications by using EWS Managed API. Currently 38 code samples are available; check back for more. For a list of the current code samples, see EWS Managed API code samples.

New EWS Managed API 2.0 reference content is now available!

$
0
0

The new EWS Managed API 2.0 is ready forprime time, and discovering how to use all the new Exchange Server 2013 features just got easier.

The EWS Managed API developer reference content has been updated to include descriptions, summaries, return values, and applicability statements for all new members.
In most cases, the updated member topics are for features that are new in Exchange 2013, but some existing members have been updated to reflect new functionality as well.  

For a list of new and updated types and member topics, see New EWS Managed API content. To find the EWS Managed API developer reference content, see EWS Managed API  namespaces.

The new and updated EWS Managed API reference content supports the following new Exchange 2013 features:

  • eDiscovery
  • Archiving
  • Retention policies
  • Mail apps for Outlook

For more information about these features, see the article New features in the EWS Managed API.

For information about the EWS Managed API 2.0, see the Exchange API-spotting post,
EWS Managed API 2.0 – now released!

For a great article that explains how to get conversation items from an Exchange mailbox by using the EWS Managed API,
check out How to: Get conversation items by using the EWS Managed API.

Don’t forget to check out our collection of code samples to help you develop Exchange 2013 applications by
using EWS Managed API. Currently, 38 code samples are available; check back for more. For a list of the current code samples, 
see EWS Managed API code samples.

EWS Java API 1.2 – get started!

$
0
0

The EWS Java API 1.2 is now available, with added support for functionality in Exchange Server 2010 SP2. It also includes an important update to the license terms that affects what you can do with the source code and the redistribution terms.

Feature-wise, we’ve implemented the following updates to the EWS Java API, which might be of interest to you:

  • The API now targets the Exchange 2010 SP2 version of the schema.
  • We've added synchronous request-response pattern implemented for handling communication with the service.
  • The FullContactData option of the ResolveNames operation now includes new directory properties.
  • Streaming notifications includes the following updates :
    • Subscription creation no longer causes a deadlock.
    • The StreamingSubscription object no longer causes a crash when the Microsoft.Exchange.Data.Storage.MailboxSession object is disposed.
  • Get password expiration date functionality has been implemented.
  • Logging capability for the HTTP headers is now included.
  • The HTTPHeader collection now correctly populates with the response HTTP headers.

For more information about what's new in the EWS Java API 1.2, see the release notes included in the download.

In some ways, the biggest change is that we have updated the license terms to give you a bit more freedom to customize the EWS Java API. The license updates enable you, the licensee, to do the following:

  1. Modify the source code to fix bugs and make improvements in your own private branch of the code.
  2. Redistribute in binary format only, as part of your application, the EWS Java API, with any changes that you have made to the original source code.
  3. Submit bug fixes or source code to Microsoft. We can incorporate the fixes into future API releases, at our discretion.

As always, be sure to review the authoritative license terms for details.

Hopefully, these more flexible terms will open more possibilities for you to incorporate Exchange integration into your products. This update has been a long time coming, so start up your IDE, rev up your (private) code repository, and take off using the latest EWS Java API!

What’s new for EWS in Exchange 2010 SP3

$
0
0

Exchange 2010 SP3 does not introduce any changes to the EWS schema or WSDL files. This means that you can use the RequestServerVersion element value of Exchange2010_SP2 to target Exchange 2010 SP3. That said, two changes in Exchange 2010 SP3 do affect EWS clients.

First, the throttling budget for Exchange impersonation scenarios uses a clone of the EWSMaxConcurrency throttling budget. This means that a user has a separate throttling budget than an account that is impersonating that user.. For more information, read the Throttling considerations for applications that use EWS impersonation section of the EWS Throttling in Exchange 2013 article.

The second change involves Exchange 2010 and Exchange 2013 coexistence. In versions of Exchange earlier than Exchange 2010 SP3, the Client Access server version has to match the Mailbox server version. Starting with Exchange 2010 SP3, a client that sends EWS requests to an Exchange 2010 Client Access server can target an Exchange 2013 mailbox.

Check out the new Exchange 2013 transport agents content!

$
0
0
Check out the new Exchange 2013 transport agent documentation!

We have updated the Exchange 2013 transport agent content to include links to
new code samples, new and updated API documentation, and new conceptual
information that describes how transport agents fit into the transport pipeline
in Exchange 2013.

For new conceptual information that will help you develop transport agents
for Exchange 2013, see Transport agent concepts.

We have added documentation for the following new enumerations:

For more information about updated API reference documentation, see New and updated
transport agent APIs
.

To learn about the .NET Framework classes you can use in your Exchange 2013
transport agents to read, write, and modify messages, see Reading and modifying
messages in the transport pipeline
.

And don’t forget to check out our Transport agent code
samples
!


Microsoft Exchange RPC Protocols Plugfest Presentations are Now Available

$
0
0

Interested in learning more about the Exchange Server RPC protocols? The Exchange Server Interoperability team is pleased to announce that presentations from the Exchange RPC Protocols Plugfest event (January 2011) are now available on Channel 9. Plugfest events are part of the Microsoft Open Specifications Program which helps developers create solutions by providing open access to technical specifications and support through a variety of channels.

If you’re working with the Microsoft Exchange protocols, check out the Exchange RPC Protocols Plugfest January 2011 series on Channel 9 for valuable information about the following topics:

  • Exchange Fast Transfer and Incremental Change Synchronization ([MS-OXCFXICS])
  • Exchange RPC and ROPs ([MS-OXCROPS])
  • Exchange Protocol Test Suite Architecture
  • Exchange Protocol Objects and Properties ([MS-OXCPRPT])

Kim Brandl
Exchange Interoperability
Microsoft Corporation

Get Into Programming with Exchange Online as part of Office 365

$
0
0

Microsoft Exchange Online as part of Microsoft Office 365 provides many of the same app-development capabilities that are available for Microsoft Exchange Server running on-site. The Exchange Developer Documentation team is pleased to announce the release of a new Exchange Online Developer Center page that will be your portal for information about Exchange Online development.

If you’re not quite up to the rock-star level as an Exchange programmer, or if Exchange Online is the only flavor of Exchange you’ve ever known, this is the place for you! And even if you’re already an experienced Exchange developer, we want to make it really easy to use that Exchange knowledge as you create apps for the Cloud.

Along with the new Exchange Online page, we have an article to help you get started writing apps that use Exchange Web Services (EWS) and EWS Managed API. This article explains the important first steps to get things running smoothly and quickly.

We have more articles coming in the near future, including one about configuring and using Exchange Autodiscover, so come back to the site often to find new information. We plan to provide great information for programming with Exchange Online for all types of developers, from experienced corporate and ISV developers to total newbies.

A bunch of articles, of course, can’t tell the whole story. As the Office 365 Beta progresses, and as the service officially becomes available, we’ll continue posting articles, blog posts, podcasts, and even videos. Because we know you’ll have questions, the writing team will also be helping out in the forums.

We look forward to hearing from you more than ever, and to helping your Exchange development projects succeed.

Best regards to our new and current readers,

 

Thom Randolph
Exchange Developer Documentation
Microsoft Corporation

Microsoft Office 2010 Developer Map now available

$
0
0

We are pleased to announce the availability of the Microsoft Office 2010 Developer Map. Whether you are new to developing with Microsoft Exchange, or a seasoned veteran, this map will guide you through the tools, applications, platforms, and services you can use to develop your application. The interactive map is a living document that provides links to MSDN Library documentation. You can also download the poster and print it out to hang on your wall.

Start visualizing the applications, services like Exchange Online, client/server data-access technologies like Exchange Web Services, on-premise servers, platform products and technologies, and tools that can help you build multiple line-of-business solutions. 

Bob Bunn
Exchange Developer Documentation
Microsoft Corporation

Exchange Online Throttling and Limits FAQ

$
0
0
What are the throttling settings for Microsoft Exchange Online as part of Microsoft Office 365? Before I answer this question, let me give you bit of background information. Microsoft Exchange includes bandwidth throttling to help manage server access. This supports service quality and consistent performance. The throttling components of Exchange Online are especially important, given that network resources in the datacenters are optimized for the broad set of customers that use the service. So, to properly engineer solutions that work with Exchange Online, you will need to account for the Exchange Online throttling settings.

We are specifically focused on throttling of Exchange Web Services (EWS) and MAPI with RPC over HTTP (as used by Microsoft Outlook) and with hard limits set by the Exchange Online system. Any mention of specific setting values were obtained for the service version 14.0.100.0. You will want to have your tenant admin obtain and confirm setting values.

Note   An on-premise Microsoft Exchange deployment may have a different throttling policy. Administrators can modify throttling settings for Microsoft Exchange on-premises. Administrators cannot configure throttling policies for Exchange Online.

What is the impact of exceeding throttling budgets?

Exchange throttling is based on the amount of Active Directory, Exchange store, and other resources a client consumes. A budget is allocated to each client to limit the resources a particular user consumes. This budget is recharged every minute.

EWS clients can exceed their budgets by sending too many concurrent requests, or by requesting too many resources on the server. When this occurs, additional requests are queued until one of two things happen:

  • The application is under budget. The request is then processed and the client experiences an increase in latency.
  • The request has been queued for more than 60 seconds, after which time the server sends an error response to the application.

When MAPI clients exceed their budgets, additional requests are returned with an error, until the application is under budget. There is no queuing of requests.

How do I get throttling settings?

Tenant administrators can view throttling settings by using Remote PowerShell and the Get-ThrottlingPolicy cmdlet. For information about how to connect Remote PowerShell for your tenant, see Install and Configure Windows PowerShell and Connect Windows PowerShell to the Service on Microsoft TechNet.

Use the Get-ThrottlingPolicy cmdlet (without arguments) to get all the throttling policy settings. Throttling policies might change to enhance service performance, so you should confirm throttling policies. We suggest that you make your client applications configurable to adjust for potential changes in throttling policy for Exchange Online. Additionally, because Exchange Online and Exchange on-premises might have different throttling policies, you may want to account for this when you design your client applications.

What are the common throttling settings?

The following throttling settings are common to both EWS and MAPI (RPC over HTTP) clients:

  • MessageRateLimit– Identifies the maximum number of messages that can be sent per minute. This is configured to count sent messages on a per IP address basis.
  • RecipientRateLimit– Identifies the maximum number of recipients that a sender can send to in a 24-hour period.
  • ForwardeeLimit– Identifies the maximum number of recipients that can be configured for Inbox rules when the user account is using the forward or redirect action.

What are the MAPI with RPC over HTTP throttling settings?

The prefix RCA in the MAPI RPC/HTTP settings represents RPC Client Access. The following throttling settings are specific to MAPI RPC over HTTP:

  • RCAMaxConcurrency– Identifies the maximum number of concurrent connections that can be maintained by MAPI RPC/HTTP clients (such as Microsoft Outlook) at any one time. Attempts to open more than the maximum number of connections will fail. Existing connections will remain unaffected. Active Directory calls count toward the number of concurrent connections. 
  • RCAPercentTimeInAD– Identifies the maximum amount of time that can be spent by a Client Access server when accessing Active Directory resources on behalf of a client, per minute. This budget is calculated by dividing the throttling value for this setting by 100 and then multiplying the result by 60 seconds. For example, an RCAPercentTimeInAD throttling value of 5 results in a throttling threshold of 3 seconds (5/100 * 60 seconds).
  • RCAPercentTimeInCAS– Identifies how much time all concurrent MAPI RPC/HTTP connections can consume on the Client Access server per minute. This is calculated on a per user basis. This budget is calculated by dividing the throttling value for this setting by 100 and then multiplying the results by 60 seconds. For example, an RCAPercentTimeInCAS throttling value of 205 results in a throttling threshold of 123 seconds (205/100 * 60 seconds). If the setting is 123 seconds, two concurrent MAPI RPC/HTTP connections can be open on a Client Access server for a full 60 seconds, thus using up 120 seconds per minute. A third connection can only use the remaining 3 seconds per minute, assuming all three connections occur concurrently and are initiated at the same time. 
  • RCAPercentTImeInMailboxRPC– Identifies how much time all concurrent MAPI RPC/HTTP connections can consume for accessing the mailbox per minute. This budget is calculated by dividing the throttling value for this setting by 100 and then multiplying the results by 60 seconds. For example, an RCAPercentTimeInMailboxRPC throttling value of 200 results in a throttling threshold of 120 seconds (200/100 * 60 seconds). This means that two connections can consume 60 seconds per minute (120 seconds total per minute) as long as there are no other connections.

What are the Exchange Web Services throttling settings?

The following throttling settings are specific to Exchange Web Services:

  • EWSFastSearchTimeoutInSeconds– Identifies how long an Exchange Search (indexed search) request will continue until it times out.
  • EWSFindCountLimit– Identifies the maximum number of search results in concurrent requests. For more information, see Throttling Policies and the EWS FindCountLimit. We suggest that searches all be paged and that the page size not exceed 1000 results.
  • EWSMaxConcurrency– Identifies the maximum number of concurrent connections that can be maintained by EWS clients at any one time. Attempts to open more than the maximum number of connections will fail. Existing connections will remain unaffected. Active Directory calls count toward the number of concurrent connections. 
  • EWSMaxSubscriptions– Identifies the maximum number of push, pull, or streaming notification subscriptions. If a server has too many notification subscriptions, it will start returning server busy errors. The server starts to return errors when the number of open connections reaches approximately 20 for a user. The charges for EWSMaxSubscription are calculated as follows:
    • Client – charged against the caller, also called the mailbox owner.
    • Intra-forest ExchangeImpersonation – charged against the caller.
    • Server-to-Server – charged against the underlying effective caller.
  • EWSPercentTimeInAD– Identifies the maximum amount of time that can be spent by a Client Access server when accessing Active Directory resources on behalf of a client account, per minute. This budget is calculated by dividing the throttling value for this setting by 100 and then multiplying the result by 60 seconds. For example, a EWSPercentTimeInAD throttling value of 50 results in a throttling threshold of 30 seconds (50/100 * 60 seconds).
  • EWSPercentTimeInCAS– Identifies how much time all concurrent EWS connections can consume on the Client Access server per minute. This is calculated on a per user basis. This budget is calculated by dividing the throttling value for this setting by 100 and then multiplying the results by 60 seconds. For example, a EWSPercentTimeInCAS throttling value of 90 results in a throttling threshold of 54 seconds (90/100 * 60 seconds).
  • EWSPercentTimeInMailboxRPC– Identifies how much time all concurrent EWS connections can consume while accessing a mailbox via RPC requests, per minute. This is calculated on a per-user basis. This budget is calculated by dividing the throttling value for this setting by 100 and then multiplying the results by 60 seconds. For example, a EWSPercentTimeInMailboxRPC throttling value of 60 results in a throttling threshold of 36 seconds (60/100 * 60 seconds). This means that a single connection can consume 36 seconds per minute as long as there are no other connections. Two connections that started at the same time can only consume 18 seconds each per minute. This is based on a threshold setting of 60.

For more information about EWS throttling policy, see EWS Best Practices: Understanding Throttling Policies.

What are the specific Exchange Web Services limits?

The following are the specific EWS throttling limits:

  • maxAllowedContentLength (IIS7) – Identifies the maximum accepted content length of HTTP requests. This maximum length is 35,000,000 bytes, which translates to 25 MB of base64-encoded data.
  • maxReceivedMessageSize (WCF) – Identifies the maximum message size that is accepted by EWS. This maximum message size is 35,000,000 bytes, which translates to 25 MB of base64-encoded data.

Note   The values for this limit differ for an on-premise Exchange 2010 deployment. In the initial release version of Exchange 2010, the message size limit is 10 MB. In Exchange 2010 Service Pack 1 (SP1), the message size limit is 35 MB.

  • maxRequestLength (ASP.Net)– Not used.

Supplemental Exchange Server Interoperability Guidance Now Available

$
0
0

The Exchange Interoperability documentation team is pleased to announce the launch of Exchange Server Interoperability Guidance that supplements the information available in the Microsoft Exchange Server protocol documentation and the Microsoft Exchange Server and Outlook Standards documentation. Whether you’re an Exchange interoperability expert, just getting started, or somewhere in between, we’re confident that this supplemental information will be a valuable resource for you.

In the first article, Exploring the Microsoft Exchange Server Open Specifications, Kim Brandl reviews the types of protocols, structures, algorithms, and standards that the Microsoft Exchange Server Open Specifications define, discusses how to get started using the specifications, explores the kinds of content that you’ll find in the various types of specifications, and addresses some key points to help you derive the maximize benefit from the specifications. Check out Exploring the Microsoft Exchange Server Open Specifications now, and stay tuned for additional technical articles coming soon!

Kim Brandl
Exchange Interoperability
Microsoft Corporation

Viewing all 108 articles
Browse latest View live




Latest Images