• Create, get, and set properties for email messages, delete email messages, delay sending email messages, attach files to email messages, add signatures to email messages, and embed images in email messages.
  • Create, delete, copy, move, or empty folders, find folder identifiers, and find folders by their display names.
  • Access a property by name, identifier, or property set GUID, and create, get, update, or delete custom extended properties.
  • Set streaming or pull notifications.
  • Find contacts by their display names, and create, get, update, or delete contacts that are associated with an email account.
  • Get or set OOF settings or messages for users.
  • Get availability information for users or rooms.
  • Get a set of meeting times for prospective meeting attendees, get a list of rooms, respond to meeting invitations, and create, get, update, or delete meetings or appointments.
  • Get email addresses that are members of distribution or room lists.
  • Get user names that are associated with an email address.
  • Create, get, update, or delete Inbox rules.
  • Create search folders or filters, find conversations, and find contacts.
  • Create, get, update, or delete single-occurrence or recurring tasks.
  • Get a list of delegates for an account, add or remove delegates from an account, and set delegate access permissions for specific folders.
  • Create, get, update, or delete user information and configuration details, and add or remove delegates from an email account.

All the samples are in the form of Visual Studio solutions.

Prerequisites

The samples require the following:

  • A target server that is running a version of Exchange starting with Exchange Server 2007 Service Pack 1 (SP1), including Exchange Online.
  • The .NET Framework 4.
  • The EWS Managed API assembly file, Microsoft.Exchange.WebServices.dll. You can download the assembly from the Microsoft Download Center. The samples assume that the assembly is in the default download directory. You will need to verify the path before you run the solution for an individual sample.
  • A version of Visual Studio starting with Visual Studio 2010.
    Or
    A text editor to create and edit source code files and a command prompt window to run a .NET Framework command line compiler.

Key components of the sample

Each sample typically contains the following files:

  • *.sln — A Visual Studio solution file for the project.
  • *.csproj — One or more Visual Studio project files.
  • app.config — The configuration data for the project.
  • *.cs — The using statements, namespace, class, and functions that showcase a specific feature.
  • Authentication.csproj — The Visual Studio project file for the dependent authentication code.
  • TextFileTraceListener.cs — The using statements, namespace, class, and code for writing the XML request and response to a text file.
  • Service.cs — The using statements, namespace, class, and functions that are necessary for acquiring an ExchangeService object that is used in the project.
  • CertificateCallback.cs — The using statements, namespace, class, and code for acquiring an X509 certificate.
  • UserData.cs — The using statements, namespace, class, and functions for acquiring the user information that is required by the service object.

Security note 

The certificate callback function in the Authentication project is meant for an on-premises test installation of Exchange that uses the default, self-signed certificate. We include this callback function to make it possible to run the Exchange 101 code samples without having to install a signed certificate. In production, the Exchange server should have a valid, signed certificate. The sample authentication code should not be used on a server that has a signed certificate and it should not be used on a production server. To activate the callback method, follow the instructions in the code comments for the Authentication project. 

Configure the sample

Follow these steps to configure the Exchange 2013: 101 code samples package.

  1. In Visual Studio, set the startup project by selecting the project in the Solution Explorer and choosing "Set as StartUp Project" from the Project menu.
  2. Ensure that the reference path for the Microsoft.Exchange.WebServices.dll file points to the location where the DLL is installed on your local computer.

Build the samples

Press F5 to build and deploy the samples.

Run and test the samples

Press F5 to run the samples.

Related content

Change log

Date

Description

December 2013

Added 31 samples and clarified the intended use of the Authentication project.

June 2013

First release.