Wednesday, August 30, 2017

office/Exchange 2013 Update

Download

Introduction

This sample shows you how to use the Exchange Web Services (EWS) Managed API to update contact properties such as the company name for a contact.

Description

This sample authenticates an email address and password entered from the console, looks for a contact by display name, creates the contact if the contact is not found, updates a property on the contact (the company name), and then commits the change to the Exchange server.

Prerequisites

This sample requires the following:

  • A target server that is running a version of Exchange starting with Exchange Server 2007 Service Pack 1 (SP1), including Exchange Online as part of Office 365.
  • The .NET Framework 4.
  • The EWS Managed API assembly file, Microsoft.Exchange.WebServices.dll. You can download the assembly from the Microsoft Download Center.

Note: This sample assumes that the assembly is in the default download directory. You will need to verify the path before you run the solution.

  • Visual Studio 2010 with the Visual Web Developer and C# components and an open Visual Studio 2010 solution.
    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

The Exchange 2013: Update contacts programmatically on Exchange servers sample contains the following files:

  • Ex15UpdateContact.sln — The Visual Studio 2010 solution file for the Ex15UpdateContact project.
  • Ex15UpdateContact.csproj — The Visual Studio 2010 project file for the UpdateContact function.
  • Ex15UpdateContact.cs — Contains the using statements, namespace, class, and functions to update a contact property such as a company name.
  • app.config —Contains configuration data for the Ex15UpdateContact project.
  • Ex15CreateContact.csproj — The Visual Studio 2010 project file for the CreateContact function.
  • Ex15CreateContact.cs — Contains the using statements, namespace, class, and functions to create a contact and populate it with information.
  • app.config — Contains configuration data for the Ex15CreateContact project.
  • Ex15FindContactByDisplayName.csproj — The Visual Studio 2010 project file for the FindContactByDisplayName function.
  • Ex15FindContactByDisplayName.cs — Contains the using statements, namespace, class, and functions to find a unique contact in the contacts folder that matches a provided display name.
  • app.config — Contains configuration data for the Ex15FindContactByDisplayName project.
  • Authentication.csproj — The Visual Studio 2010 project file for the dependent authentication code.
  • TextFileTraceListener.cs — Contains the using statements, namespace, class, and code to write the XML request and response to a text file.
  • Service.cs — Contains the using statements, namespace, class, and functions necessary to acquire the ExchangeService object used in the Ex15UpdateContact project.
  • CertificateCallback.cs — Contains the using statements, namespace, class, and code to acquire an X509 certificate.
  • UserData.cs — Contains the using statements, namespace, class, and functions necessary to acquire user information required by the service object.

Configure the sample

Follow these steps to configure the Exchange 2013: Update contacts programmatically on Exchange servers sample.

  1. Set the startup project to Ex15UpdateContact 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 points to where the DLL is installed on your local computer.

Build the sample

  • Press F5 to build and deploy the sample.
  • Run and test the sample
  • Press F5 to run the sample.

Change log

First release.

More Information

 

No comments:

Post a Comment