ExchangeService Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a binding to Exchange Web Services (EWS).
public ref class ExchangeService sealed : Microsoft::Exchange::WebServices::Data::ExchangeServiceBase
public sealed class ExchangeService : Microsoft.Exchange.WebServices.Data.ExchangeServiceBase
Public NotInheritable Class ExchangeService
Inherits ExchangeServiceBase
- Inheritance
Examples
Now let's see it all in action. The following code example shows you how to set a specific user name and password, discover the EWS endpoint by using Autodiscover, create two new contacts in the user's default Contacts folder, and grant a second user delegate access to the user's Calendar folder.
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Net;
using System.Security;
using Microsoft.Exchange.WebServices.Data;
static bool RedirectionCallback(string url)
{
return url.ToLower().StartsWith("https://");
}
static void UseExchangeService(string userEmailAddress, SecureString userPassword)
{
ExchangeService service = new ExchangeService();
#region Authentication
// Set specific credentials.
service.Credentials = new NetworkCredential(userEmailAddress, userPassword);
#endregion
#region Endpoint management
// Look up the user's EWS endpoint by using Autodiscover.
service.AutodiscoverUrl(userEmailAddress, RedirectionCallback);
Console.WriteLine("EWS Endpoint: {0}", service.Url);
#endregion
#region Working with groups of items
// Create two new contacts in the user's default
// Contacts folder.
List<Contact> contactsToAdd = new List<Contact>();
Contact newContact1 = new Contact(service);
newContact1.GivenName = "Rosetta";
newContact1.Surname = "Simpson";
newContact1.PhoneNumbers[PhoneNumberKey.MobilePhone] = "425-555-1234";
newContact1.EmailAddresses[EmailAddressKey.EmailAddress1] = "rosetta@alpineskihouse.com";
contactsToAdd.Add(newContact1);
Contact newContact2 = new Contact(service);
newContact2.GivenName = "Barney";
newContact2.Surname = "Carmack";
newContact2.PhoneNumbers[PhoneNumberKey.MobilePhone] = "425-555-5678";
newContact2.EmailAddresses[EmailAddressKey.EmailAddress1] = "barney@contoso.com";
contactsToAdd.Add(newContact2);
ServiceResponseCollection<ServiceResponse> createItemsResponse =
service.CreateItems(contactsToAdd, WellKnownFolderName.Contacts, null, null);
if (createItemsResponse.OverallResult != ServiceResult.Success)
{
Console.WriteLine("CreateItems returned a non-success response!");
for (int i = 0; i < createItemsResponse.Count; i++)
{
Console.WriteLine("{0}: {1} - {2}", i + 1,
createItemsResponse[i].ErrorCode, createItemsResponse[i].ErrorMessage);
}
}
else
{
Console.WriteLine("CreateItems successfully created 2 contacts in default Contacts folder.");
}
#endregion
#region Working with delegates
// Add a user as a delegate with Reviewer rights
// to the user's Calendar folder.
Mailbox mailbox = new Mailbox(userEmailAddress);
DelegateUser newDelegate = new DelegateUser("ian@fourthcoffee.com");
newDelegate.Permissions.CalendarFolderPermissionLevel = DelegateFolderPermissionLevel.Reviewer;
List<DelegateUser> delegatesToAdd = new List<DelegateUser>();
delegatesToAdd.Add(newDelegate);
Collection<DelegateUserResponse> addDelegateResponse = service.AddDelegates(mailbox, null, delegatesToAdd);
for (int i = 0; i < addDelegateResponse.Count; i++)
{
if (addDelegateResponse[i].Result != ServiceResult.Success)
{
Console.WriteLine("Unable to add {0} as a delegate.",
addDelegateResponse[i].DelegateUser.UserId.PrimarySmtpAddress);
Console.WriteLine(" {0}: {1}", addDelegateResponse[i].ErrorCode,
addDelegateResponse[i].ErrorMessage);
}
else
{
Console.WriteLine("Added {0} as a delegate.",
addDelegateResponse[i].DelegateUser.UserId.PrimarySmtpAddress);
}
}
#endregion
}
Remarks
Before you can use the EWS Managed API to perform any task, you must create an instance of the ExchangeService class. But the ExchangeService class goes beyond just serving as a starting point for EWS Managed API client development. It has quite a bit of functionality built in.
Table 1: Ways that you can use the ExchangeService class
Control authentication | If your users log on to Windows with the same credentials they use to access their Exchange server, set the UseDefaultCredentials property to true to enable your application to connect to the Exchange server without asking the user for a user name and password.If you need to specify the user name and password, set the Credentials property. The Credentials property uses a WebCredentials object to keep users’ authentication information safe.Use the Credentials property along with the ImpersonatedUserId property to authenticate as a service account and impersonate a different user |
Manage endpoints | Use the AutodiscoverUrl(String) method to automatically find the correct EWS endpoint for your user. Alternatively, if you have the endpoint for your user cached, you can use the Url property to use that endpoint. |
Work with groups of items | Use the CopyItems(IEnumerable<ItemId>, FolderId), CreateItems(IEnumerable<Item>, FolderId, Nullable<MessageDisposition>, Nullable<SendInvitationsMode>), DeleteItems(IEnumerable<ItemId>, DeleteMode, Nullable<SendCancellationsMode>, Nullable<AffectedTaskOccurrence>), MoveItems(IEnumerable<ItemId>, FolderId), and UpdateItems(IEnumerable<Item>, FolderId, ConflictResolutionMode, Nullable<MessageDisposition>, Nullable<SendInvitationsOrCancellationsMode>) methods to perform bulk operations on multiple items. You can use these methods to handle scenarios such as creating multiple Contact objects to support the bulk import of contacts or marking multiple Task objects complete, all in a single EWS request. |
Work with delegates | Use the AddDelegates(Mailbox, Nullable<MeetingRequestsDeliveryScope>, DelegateUser[]), GetDelegates(Mailbox, Boolean, UserId[]), RemoveDelegates(Mailbox, UserId[]), and UpdateDelegates(Mailbox, Nullable<MeetingRequestsDeliveryScope>, DelegateUser[]) methods to work with delegates. |
While we can’t cover everything that you can do with the ExchangeService class here, you can find out more by exploring the methods and properties. Other features of this class that you might be interested in include:
- Automatic cookie management
- Client logging for troubleshooting
- Rules and Automatic Replies (Out of Office) settings management
- Name resolution against the address book
- Mailbox search
Constructors
ExchangeService() |
Initializes a new instance of the ExchangeService class, targeting the latest supported version of Exchange Web Services (EWS) and scoped to the system's current time zone. |
ExchangeService(ExchangeVersion, TimeZoneInfo) |
Initializes a new instance of the ExchangeService class, targeting the specified version of Exchange Web Services (EWS) and scoped to the specified time zone. |
ExchangeService(ExchangeVersion) |
Initializes a new instance of the ExchangeService class, targeting the specified version of Exchange Web Services (EWS) and scoped to the system's current time zone. |
ExchangeService(TimeZoneInfo) |
Initializes a new instance of the ExchangeService class, targeting the latest supported version of Exchange Web Services (EWS) and scoped to the specified time zone. |
Properties
AcceptGzipEncoding |
Gets or sets a value that indicates whether GZip compression encoding should be accepted. (Inherited from ExchangeServiceBase) |
ClientRequestId |
Gets or sets the request ID. The ClientRequestId property is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. (Inherited from ExchangeServiceBase) |
ConnectionGroupName |
Gets or sets the name of the connection group for the request. The ConnectionGroupName property is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. (Inherited from ExchangeServiceBase) |
CookieContainer |
Gets or sets the cookie container. (Inherited from ExchangeServiceBase) |
Credentials |
Gets or sets the credentials that are used to authenticate with Exchange Web Services (EWS). (Inherited from ExchangeServiceBase) |
DateTimePrecision |
Gets or set the degree of precision used for DateTime values returned from Exchange Web Services (EWS).This property was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
EnableScpLookup |
Gets or sets a value that indicates whether Exchange Web Services (EWS) should perform a service connection point (SCP) lookup when it is determining the service URL. |
FileAttachmentContentHandler |
Gets or sets a file attachment content handler. |
HttpHeaders |
Gets a list of HTTP headers associated with requests to Exchange Web Services (EWS). (Inherited from ExchangeServiceBase) |
HttpResponseHeaders |
Gets a collection of HTTP headers from the last response. The HttpResponseHeaders property is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. (Inherited from ExchangeServiceBase) |
ImpersonatedUserId |
Gets or sets the ID of the user who Exchange Web Services (EWS) is to impersonate. |
KeepAlive |
Gets or sets whether a request should contain a Keep-alive header. The KeepAlive property is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. (Inherited from ExchangeServiceBase) |
ManagementRoles |
Gets or sets the user and application roles used to restrict access based on group membership.The ManagementRoles property is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
PreAuthenticate |
Gets or sets a value that indicates whether HTTP pre-authentication should be performed. (Inherited from ExchangeServiceBase) |
PreferredCulture |
Gets or sets the preferred culture for messages that are returned by Exchange Web Services (EWS). |
RequestedServerVersion |
Gets the requested server version. (Inherited from ExchangeServiceBase) |
ReturnClientRequestId |
Gets or sets a flag indicating that a client requires responses to include the request ID. The ReturnClientRequestId property is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. (Inherited from ExchangeServiceBase) |
SendClientLatencies |
Gets or sets whether client latency information must be sent by the client. The SendClientLatencies property is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. (Inherited from ExchangeServiceBase) |
ServerInfo |
Gets information that is associated with the server that processed the most recent request. (Inherited from ExchangeServiceBase) |
Timeout |
Gets or sets the timeout that is used when sending HTTP requests and when receiving HTTP responses, in milliseconds. (Inherited from ExchangeServiceBase) |
TimeZone |
Gets the time zone to which Exchange Web Services (EWS) is scoped. |
TraceEnabled |
Gets or sets a value that indicates whether tracing is enabled. (Inherited from ExchangeServiceBase) |
TraceEnablePrettyPrinting |
Gets or sets a value indicating whether the trace output has stylistic formatting conventions applied. The TraceEnablePrettyPrinting property is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
TraceFlags |
Gets or sets the trace flags. (Inherited from ExchangeServiceBase) |
TraceListener |
Gets or sets the trace listener. (Inherited from ExchangeServiceBase) |
UnifiedMessaging |
Provides access to the Unified Messaging (UM) functionalities. |
Url |
Gets or sets the URL of Exchange Web Services (EWS). |
UseDefaultCredentials |
Gets or sets a value that indicates whether the credentials of the user who is currently logged on to Windows should be used to authenticate with Exchange Web Services (EWS). (Inherited from ExchangeServiceBase) |
UserAgent |
Gets or sets the user agent. (Inherited from ExchangeServiceBase) |
WebProxy |
Gets or sets the Web proxy server that handles requests. (Inherited from ExchangeServiceBase) |
Methods
AddDelegates(Mailbox, Nullable<MeetingRequestsDeliveryScope>, DelegateUser[]) |
Adds delegates to a specific mailbox. |
AddDelegates(Mailbox, Nullable<MeetingRequestsDeliveryScope>, IEnumerable<DelegateUser>) |
Adds delegates to a specified mailbox. |
ArchiveItems(IEnumerable<ItemId>, FolderId) |
Archives multiple items in a target folder. The ArchiveItems(IEnumerable<ItemId>, FolderId) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
AutodiscoverUrl(String, AutodiscoverRedirectionUrlValidationCallback) |
Initializes the Url property to the Exchange Web Services (EWS) endpoint for a specified email address by calling the Autodiscover service. |
AutodiscoverUrl(String) |
Initializes the Url property to the Exchange Web Services (EWS) endpoint for a specified email address by calling the Autodiscover service. |
BeginGetNonIndexableItemDetails(AsyncCallback, Object, GetNonIndexableItemDetailsParameters) |
Asynchronous call to get non indexable item details |
BeginGetNonIndexableItemStatistics(AsyncCallback, Object, GetNonIndexableItemStatisticsParameters) |
Asynchronous call to get non indexable item statistics |
BeginSearchMailboxes(AsyncCallback, Object, SearchMailboxesParameters) |
Initiates an asynchronous request to search mailboxes for items that match a query string by using the associated SearchMailboxesParameters object to specify details of the search request. The BeginSearchMailboxes(AsyncCallback, Object, SearchMailboxesParameters) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
BeginSubscribeToPullNotifications(AsyncCallback, Object, IEnumerable<FolderId>, Int32, String, EventType[]) |
Begins an asynchronous request to subscribe to pull notifications.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
BeginSubscribeToPullNotificationsOnAllFolders(AsyncCallback, Object, Int32, String, EventType[]) |
Begins an asynchronous request to subscribe to pull notifications on all folders in a specified user's mailbox.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
BeginSubscribeToPushNotifications(AsyncCallback, Object, IEnumerable<FolderId>, Uri, Int32, String, EventType[]) |
Begins an asynchronous request to subscribe to push notifications. The BeginSubscribeToPushNotifications(AsyncCallback, Object, IEnumerable<FolderId>, Uri, Int32, String, EventType[]) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
BeginSubscribeToPushNotifications(AsyncCallback, Object, IEnumerable<FolderId>, Uri, Int32, String, String, EventType[]) |
Begins an asynchronous request to subscribe to push notifications that includes a request for additional information to be returned in the push notification response. The BeginSubscribeToPushNotifications(AsyncCallback, Object, IEnumerable<FolderId>, Uri, Int32, String, String, EventType[]) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
BeginSubscribeToPushNotificationsOnAllFolders(AsyncCallback, Object, Uri, Int32, String, EventType[]) |
Begins an asynchronous request to subscribe to push notifications on all folders in a specified user's mailbox. The BeginSubscribeToPushNotificationsOnAllFolders(AsyncCallback, Object, Uri, Int32, String, EventType[]) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
BeginSubscribeToPushNotificationsOnAllFolders(AsyncCallback, Object, Uri, Int32, String, String, EventType[]) |
Begins an asynchronous request to subscribe to push notifications on all folders in the authenticated user's mailbox that includes a request for additional information to be returned in the push notification response. The BeginSubscribeToPushNotificationsOnAllFolders(AsyncCallback, Object, Uri, Int32, String, String, EventType[]) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
BeginSubscribeToStreamingNotifications(AsyncCallback, Object, IEnumerable<FolderId>, EventType[]) |
Begins an asynchronous request to subscribe to streaming notifications.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
BeginSubscribeToStreamingNotificationsOnAllFolders(AsyncCallback, Object, EventType[]) |
Begins an asynchronous request to subscribe to streaming notifications on all folders in a specified user's mailbox.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
BeginSyncFolderHierarchy(AsyncCallback, Object, FolderId, PropertySet, String) |
Begins an asynchronous request to synchronize the subfolders of a specified folder hierarchy.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
BeginSyncFolderHierarchy(AsyncCallback, Object, PropertySet, String) |
Begins a request to synchronize the entire folder hierarchy of a specified mailbox.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
BeginSyncFolderItems(AsyncCallback, Object, FolderId, PropertySet, IEnumerable<ItemId>, Int32, SyncFolderItemsScope, String) |
Begins an asynchronous request to synchronize the items contained in a specified folder.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
BindToItems(IEnumerable<ItemId>, PropertySet) |
Binds to multiple items in a single call to Exchange Web Services (EWS). |
ConvertId(AlternateIdBase, IdFormat) |
Converts an ID from one format to another format in a single Exchange Web Services (EWS) call. |
ConvertIds(IEnumerable<AlternateIdBase>, IdFormat) |
Converts multiple IDs from one format to another in a single call to Exchange Web Services (EWS). |
CopyItems(IEnumerable<ItemId>, FolderId, Boolean) |
Copies multiple items in a single call to Exchange Web Services (EWS).This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
CopyItems(IEnumerable<ItemId>, FolderId) |
Copies multiple items in a single call to Exchange Web Services (EWS). |
CopyItemsInConversations(IEnumerable<KeyValuePair<ConversationId,Nullable<DateTime>>>, FolderId, FolderId) |
Copies the items in a specified conversation to a specified destination folder. |
CreateItems(IEnumerable<Item>, FolderId, Nullable<MessageDisposition>, Nullable<SendInvitationsMode>) |
Creates multiple items in a single Exchange Web Services (EWS) call. |
DeleteItems(IEnumerable<ItemId>, DeleteMode, Nullable<SendCancellationsMode>, Nullable<AffectedTaskOccurrence>, Boolean) |
Deletes multiple items in a single call to EWS. |
DeleteItems(IEnumerable<ItemId>, DeleteMode, Nullable<SendCancellationsMode>, Nullable<AffectedTaskOccurrence>) |
Deletes multiple items in a single call to Exchange Web Services (EWS). |
DeleteItemsInConversations(IEnumerable<KeyValuePair<ConversationId,Nullable<DateTime>>>, FolderId, DeleteMode) |
Deletes the items in a specified conversation. |
DisableAlwaysCategorizeItemsInConversations(IEnumerable<ConversationId>, Boolean) |
Disables automatic categorization of new items that are received in a specified conversation. |
DisableAlwaysDeleteItemsInConversations(IEnumerable<ConversationId>, Boolean) |
Disables the automatic moving of items from a specified conversation to the Deleted Items folder. |
DisableAlwaysMoveItemsInConversations(IEnumerable<ConversationId>, Boolean) |
Disables the automatic moving of items from a specified conversation to a specified folder. |
DisableApp(String, DisableReasonType) |
Disables a client extension. The DisableApp(String, DisableReasonType) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
EnableAlwaysCategorizeItemsInConversations(IEnumerable<ConversationId>, IEnumerable<String>, Boolean) |
Enables the automatic categorization of items in a specified conversation. |
EnableAlwaysDeleteItemsInConversations(IEnumerable<ConversationId>, Boolean) |
Enables the automatic moving of items from a specified conversation to the Deleted Items folder. |
EnableAlwaysMoveItemsInConversations(IEnumerable<ConversationId>, FolderId, Boolean) |
Enables the automatic move of new and existing items in a conversation to a target folder. |
EndGetNonIndexableItemDetails(IAsyncResult) |
Asynchronous call requesting metadata about folder items that could not be indexed. |
EndGetNonIndexableItemStatistics(IAsyncResult) |
Asynchronous call requesting statistics about folder items that could not be indexed. |
EndSearchMailboxes(IAsyncResult) |
Requests a search mailboxes query asynchronously. The EndSearchMailboxes(IAsyncResult) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
EndSubscribeToPullNotifications(IAsyncResult) |
Ends an asynchronous request to subscribe to pull notifications in the authenticated user's mailbox.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
EndSubscribeToPushNotifications(IAsyncResult) |
Ends an asynchronous request to subscribe to push notifications in a specified user's mailbox.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
EndSubscribeToStreamingNotifications(IAsyncResult) |
Ends an asynchronous request to subscribe to streaming notifications in a specified user's mailbox.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
EndSyncFolderHierarchy(IAsyncResult) |
Ends an asynchronous request to synchronize a specified folder hierarchy of a mailbox.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
EndSyncFolderItems(IAsyncResult) |
Ends an asynchronous request to synchronize the items in a specified folder of a mailbox.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
ExpandGroup(EmailAddress) |
Expands a group identified by a specified email address. |
ExpandGroup(ItemId) |
Expands a group identified by a specified group ID. |
ExpandGroup(String, String) |
Expands a group identified by a specified group SMTP address and the routing type of that address. |
ExpandGroup(String) |
Expands a group identified by a specified group SMTP address. |
FindAppointments(FolderId, CalendarView) |
Obtains a list of appointments by searching the contents of a specified folder. |
FindAppointments(WellKnownFolderName, CalendarView) |
Obtains a list of appointments by searching the contents of a specified folder. |
FindConversation(ViewBase, FolderId, String, Boolean, Nullable<MailboxSearchLocation>) |
Searches for and retrieves a collection of conversations in the specified folder according to the specified query. Along with conversations, a list of highlighted terms are returned. The target folder(s) may be a primary mailbox, an archive mailbox, or both. The FindConversation(ViewBase, FolderId, String, Boolean, Nullable<MailboxSearchLocation>) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
FindConversation(ViewBase, FolderId, String, Boolean) |
Searches for and retrieves a collection of conversations in the specified folder according to the specified query. Along with conversations, a list of highlighted terms are returned. The FindConversation(ViewBase, FolderId, String, Boolean) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
FindConversation(ViewBase, FolderId, String) |
Retrieves a collection of all conversations in the specified folder according to the specified query. The FindConversation(ViewBase, FolderId, String) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
FindConversation(ViewBase, FolderId) |
Retrieves a collection of all conversations in the specified folder. The FindConversation(ViewBase, FolderId) method is applicable for clients that target Exchange Online and versions of Exchange starting with Microsoft Exchange Server 2010 Service Pack 1 (SP1). |
FindFolders(FolderId, FolderView) |
Obtains a list of folders by searching the subfolders of a specified folder. |
FindFolders(FolderId, SearchFilter, FolderView) |
Searches a folder by using a specified search filter and a specified folder view. |
FindFolders(WellKnownFolderName, FolderView) |
Obtains a list of folders by searching the subfolders of the specified folder. |
FindFolders(WellKnownFolderName, SearchFilter, FolderView) |
Searches a well-known folder by using a specified search filter and a specified folder view. |
FindItems(FolderId, SearchFilter, ViewBase, Grouping) |
Obtains a grouped list of items by searching the contents of a specific folder. |
FindItems(FolderId, SearchFilter, ViewBase) |
Returns items from a target folder filtered by item type with the specified preview page view. |
FindItems(FolderId, String, Boolean, ViewBase, Grouping) |
Returns grouped items from a target folder according to the associated search query, optionally with terms highlighted. The FindItems(FolderId, String, Boolean, ViewBase, Grouping) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
FindItems(FolderId, String, Boolean, ViewBase) |
Returns items from a target folder according to the associated search query with the specified preview page view and optional term highlighting. The FindItems(FolderId, String, Boolean, ViewBase) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
FindItems(FolderId, String, ViewBase, Grouping) |
Returns grouped items from a target folder according to the specified query.The FindItems(FolderId, String, ViewBase, Grouping) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2010. |
FindItems(FolderId, String, ViewBase) |
Returns items from a target folder according to the associated search query with the specified preview page view. The FindItems(FolderId, String, ViewBase) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2010. |
FindItems(FolderId, ViewBase, Grouping) |
Returns grouped items from a target folder with the specified preview page view. |
FindItems(FolderId, ViewBase) |
Returns items from a target folder with the specified preview page view. |
FindItems(WellKnownFolderName, SearchFilter, ViewBase, Grouping) |
Returns grouped items filtered by type from the target folder according to the specified preview page view. |
FindItems(WellKnownFolderName, SearchFilter, ViewBase) |
Returns items filtered by type from a target folder with the specified preview page view. |
FindItems(WellKnownFolderName, String, ViewBase, Grouping) |
Returns grouped items from a target folder using the associated query with the specified preview page view. The FindItems(WellKnownFolderName, String, ViewBase, Grouping) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2010. |
FindItems(WellKnownFolderName, String, ViewBase) |
Returns items from a target folder using the associated query with the specified preview page view. The FindItems(WellKnownFolderName, String, ViewBase) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2010. |
FindItems(WellKnownFolderName, ViewBase) |
Returns items from a target folder with the specified preview page view. |
GetAppManifests() |
Gets the app manifests for apps installed on the server.The GetAppManifests() method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetAppManifests(String, String) |
Gets the app manifests for apps installed on the server that support the specified API and schema version.The GetAppManifests(String, String) method is applicable for clients that target Exchange Online and versions of Exchange starting with 15.00.0847.032. |
GetAppMarketplaceUrl() |
Gets the URL of the apps marketplace.The GetAppMarketplaceUrl() method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetAppMarketplaceUrl(String, String) |
Gets the URL of the apps marketplace, based on the supported API and schema version.The GetAppMarketplaceUrl(String, String) method is applicable for clients that target Exchange Online and versions of Exchange starting with 15.00.0847.032. |
GetAttachments(Attachment[], Nullable<BodyType>, IEnumerable<PropertyDefinitionBase>) |
Gets attachments properties from the server. |
GetAttachments(String[], Nullable<BodyType>, IEnumerable<PropertyDefinitionBase>) |
Gets attachments properties from the server. |
GetClientAccessToken(ClientAccessTokenRequest[]) |
Gets a collection of token identifiers and types based on an array of ClientAccessTokenRequest objects.The GetClientAccessToken(ClientAccessTokenRequest[]) method is applicable for clients that target Exchange Online and versions of Exchange starting with 15.00.0847.032. |
GetClientAccessToken(IEnumerable<KeyValuePair<String,ClientAccessTokenType>>) |
Gets a collection of token identifiers and types based on key value pairs of token IDs and token types.The GetClientAccessToken(IEnumerable<KeyValuePair<String,ClientAccessTokenType>>) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetClientExtension(StringList, Boolean, Boolean, String, StringList, StringList, Boolean) |
Gets client extension information. This method is used in server-to-server calls to retrieve organization extensions for the administrator's Windows PowerShell or Exchange Unified Management Console (UMC) access and for the user's Windows PowerShell or UMC access, as well as user's activation for Outlook Web Access (OWA) or Outlook. This method is not expected to be used or called directly from a user client. The GetClientExtension(StringList, Boolean, Boolean, String, StringList, StringList, Boolean) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetConversationItems(ConversationId, PropertySet, String, IEnumerable<FolderId>, Nullable<ConversationSortOrder>) |
Gets some or all items in a conversation specified by a conversation identifier. The items retrieved have the specified properties, are synchronized with the server according to information supplied by a synchronization state, and are sorted according to a sort order. The items returned may be further limited by selectively ignoring folders in the search hierarchy. The GetConversationItems(ConversationId, PropertySet, String, IEnumerable<FolderId>, Nullable<ConversationSortOrder>) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetConversationItems(IEnumerable<ConversationRequest>, PropertySet, IEnumerable<FolderId>, Nullable<ConversationSortOrder>, Nullable<MailboxSearchLocation>) |
Gets items associated with a set of conversations. The items retrieved have the additional properties specified and are sorted according to a sort order. The set of items returned may be further limited by selectively ignoring folders in the search hierarchy and whether the target mailboxes are primary, archive, or both. The GetConversationItems(IEnumerable<ConversationRequest>, PropertySet, IEnumerable<FolderId>, Nullable<ConversationSortOrder>, Nullable<MailboxSearchLocation>) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetConversationItems(IEnumerable<ConversationRequest>, PropertySet, IEnumerable<FolderId>, Nullable<ConversationSortOrder>) |
Gets the items associated with a set of conversations. The items retrieved have the specified additional properties and are sorted according to a sort order. The items returned are limited by selectively ignoring folders in the search hierarchy. The GetConversationItems(IEnumerable<ConversationRequest>, PropertySet, IEnumerable<FolderId>, Nullable<ConversationSortOrder>) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetDelegates(Mailbox, Boolean, IEnumerable<UserId>) |
Retrieves the delegates from a specified mailbox. |
GetDelegates(Mailbox, Boolean, UserId[]) |
Retrieves the delegates from a specified mailbox. |
GetDiscoverySearchConfiguration(String, Boolean, Boolean) |
Gets search configuration information for the purpose of eDiscovery. The GetDiscoverySearchConfiguration(String, Boolean, Boolean) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetEncryptionConfiguration() |
For internal use only. |
GetHoldOnMailboxes(String) |
Gets information about an eDiscovery hold on mailboxes. The GetHoldOnMailboxes(String) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetInboxRules() |
Retrieves a collection of Inbox rules that are associated with the specified user. |
GetInboxRules(String) |
Retrieves a collection of Inbox rules that are associated with a specified user. |
GetNonIndexableItemDetails(GetNonIndexableItemDetailsParameters) |
Gets information about items in the target mailboxes that could not be indexed using the associated GetNonIndexableItemDetailsParameters object. The GetNonIndexableItemDetails(GetNonIndexableItemDetailsParameters) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetNonIndexableItemDetails(String[], Nullable<Int32>, String, Nullable<SearchPageDirection>) |
Gets information about items in the target mailboxes that could not be indexed, including the size of the page view, the reference identifier of the page view, and the search direction for the page view (forward or back). The GetNonIndexableItemDetails(String[], Nullable<Int32>, String, Nullable<SearchPageDirection>) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetNonIndexableItemDetails(String[]) |
Gets information about items in the target mailboxes that could not be indexed. The GetNonIndexableItemDetails(String[]) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetNonIndexableItemStatistics(GetNonIndexableItemStatisticsParameters) |
Gets statistical information about items in the target mailboxes that could not be indexed using the associated GetNonIndexableItemStatisticsParameters object. The GetNonIndexableItemStatistics(GetNonIndexableItemStatisticsParameters) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetNonIndexableItemStatistics(String[]) |
Gets statistical information about items in the target mailboxes that could not be indexed. The GetNonIndexableItemStatistics(String[]) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetPasswordExpirationDate(String) |
Gets the domain password expiration date for a specified mailbox user. This method was introduced in Exchange Server 2010 SP2 and the Exchange Web Services (EWS) Managed API 1.2. |
GetRoomLists() |
Retrieves a collection of all room lists in a specified organization. |
GetRooms(EmailAddress) |
Retrieves a collection of all rooms in a specified room list in an organization. |
GetSearchableMailboxes(String, Boolean) |
Gets two lists of mailboxes: a list of mailboxes that could be searched and a list of mailboxes that could not be searched for the purpose of eDiscovery. The GetSearchableMailboxes(String, Boolean) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
GetUserAvailability(IEnumerable<AttendeeInfo>, TimeWindow, AvailabilityData, AvailabilityOptions) |
Retrieves detailed information about the availability of a set of users, rooms, and resources within a specified time period. |
GetUserAvailability(IEnumerable<AttendeeInfo>, TimeWindow, AvailabilityData) |
Retrieves detailed information about the availability of a set of users, rooms, and resources during a specified time period. |
GetUserOofSettings(String) |
Gets Out of Office (OOF) settings for a specified mailbox. |
GetUserRetentionPolicyTags() |
Gets user retention policy tags. The GetUserRetentionPolicyTags() method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
InstallApp(Stream) |
Installs a mail app. The InstallApp(Stream) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
LoadPropertiesForItems(IEnumerable<Item>, PropertySet) |
Loads the properties of multiple items in a single call to Exchange Web Services (EWS). |
MarkAsJunk(IEnumerable<ItemId>, Boolean, Boolean) |
Marks mailbox items as junk. The MarkAsJunk(IEnumerable<ItemId>, Boolean, Boolean) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
MoveItems(IEnumerable<ItemId>, FolderId, Boolean) |
Moves multiple items in a single call to Exchange Web Services (EWS).This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
MoveItems(IEnumerable<ItemId>, FolderId) |
Moves multiple items in a single call to Exchange Web Services (EWS). |
MoveItemsInConversations(IEnumerable<KeyValuePair<ConversationId,Nullable<DateTime>>>, FolderId, FolderId) |
Moves items from a specified conversation to a specified destination folder. |
RemoveDelegates(Mailbox, IEnumerable<UserId>) |
Removes delegates from a specific mailbox. |
RemoveDelegates(Mailbox, UserId[]) |
Removes delegates from a specified mailbox. Calling this method results in a call to Exchange Web Services (EWS). |
ResolveName(String, IEnumerable<FolderId>, ResolveNameSearchLocation, Boolean, PropertySet) |
Finds contacts in the Global Address List (GAL) and/or in specific contact folders whose names match the specified name.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
ResolveName(String, IEnumerable<FolderId>, ResolveNameSearchLocation, Boolean) |
Finds contacts in specified contact folders and/or the Global Address List (GAL) that have names matching the name that was passed as a parameter. |
ResolveName(String, ResolveNameSearchLocation, Boolean, PropertySet) |
Finds contacts in the Global Address List (GAL) whose names match the specified name.This method was introduced in the Exchange Web Services (EWS) Managed API 1.2. |
ResolveName(String, ResolveNameSearchLocation, Boolean) |
Finds contacts in the default contacts folder and/or the Global Address List (GAL) that have names matching the name that was passed as a parameter. |
ResolveName(String) |
Finds contacts in the user's Contacts folder and the Global Address List (GAL) — in that order — that have names matching the name that was passed as a parameter. |
SearchMailboxes(IEnumerable<MailboxQuery>, SearchResultType, String, SortDirection, Int32, SearchPageDirection, String) |
Searches mailboxes for items that match a set of query strings and returns a sorted, ordered result of preview items. The SearchMailboxes(IEnumerable<MailboxQuery>, SearchResultType, String, SortDirection, Int32, SearchPageDirection, String) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SearchMailboxes(IEnumerable<MailboxQuery>, SearchResultType) |
Searches mailboxes for items that match a set of query strings. The search result can be either statistical or an item preview. The SearchMailboxes(IEnumerable<MailboxQuery>, SearchResultType) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SearchMailboxes(SearchMailboxesParameters) |
Searches mailboxes for items that match a query string using the associated SearchMailboxesParameters object to specify details of the search request. The SearchMailboxes(SearchMailboxesParameters) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SetClientExtension(List<SetClientExtensionAction>) |
Sets the client extension data. This method is used in server-to-server calls to install, uninstall, or configure organization extensions to support the administrator's management of organization extensions via Windows PowerShell or the Exchange Unified Management Console (UMC). The SetClientExtension(List<SetClientExtensionAction>) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SetEncryptionConfiguration(String, String, String, String) |
For internal use only. |
SetFlagStatusForItemsInConversations(IEnumerable<KeyValuePair<ConversationId,Nullable<DateTime>>>, FolderId, Flag) |
Sets the flag status of items in conversations. The SetFlagStatusForItemsInConversations(IEnumerable<KeyValuePair<ConversationId,Nullable<DateTime>>>, FolderId, Flag) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SetHoldOnMailboxes(SetHoldOnMailboxesParameters) |
Sets a query-based hold on items in one or more mailboxes for the purpose of eDiscovery.The SetHoldOnMailboxes(SetHoldOnMailboxesParameters) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SetHoldOnMailboxes(String, HoldAction, String, String, String) |
Sets a query-based hold on items in a mailbox for a specific duration for the purpose of eDiscovery.The SetHoldOnMailboxes(String, HoldAction, String, String, String) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SetHoldOnMailboxes(String, HoldAction, String, String) |
Sets a query-based hold on items in a mailbox for the purpose of eDiscovery. The SetHoldOnMailboxes(String, HoldAction, String, String) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SetHoldOnMailboxes(String, HoldAction, String, String[]) |
Sets a query-based hold on items on a collection of mailboxes for the purpose of eDiscovery. The SetHoldOnMailboxes(String, HoldAction, String, String[]) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SetReadStateForItemsInConversations(IEnumerable<KeyValuePair<ConversationId,Nullable<DateTime>>>, FolderId, Boolean, Boolean) |
Sets the read state of items in a conversation and optionally sets a value that suppresses read receipts. The SetReadStateForItemsInConversations(IEnumerable<KeyValuePair<ConversationId,Nullable<DateTime>>>, FolderId, Boolean, Boolean) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SetReadStateForItemsInConversations(IEnumerable<KeyValuePair<ConversationId,Nullable<DateTime>>>, FolderId, Boolean) |
Sets the read state of items in a conversation.The SetReadStateForItemsInConversations(IEnumerable<KeyValuePair<ConversationId,Nullable<DateTime>>>, FolderId, Boolean) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SetRetentionPolicyForItemsInConversations(IEnumerable<KeyValuePair<ConversationId,Nullable<DateTime>>>, FolderId, RetentionType, Nullable<Guid>) |
Sets the retention policy for items in conversation. The SetRetentionPolicyForItemsInConversations(IEnumerable<KeyValuePair<ConversationId,Nullable<DateTime>>>, FolderId, RetentionType, Nullable<Guid>) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SetTeamMailbox(EmailAddress, Uri, TeamMailboxLifecycleState) |
Sets a shared mailbox. The SetTeamMailbox(EmailAddress, Uri, TeamMailboxLifecycleState) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SetUserOofSettings(String, OofSettings) |
Sets the Out of Office (OOF) settings for a specified mailbox. |
SubscribeToPullNotifications(IEnumerable<FolderId>, Int32, String, EventType[]) |
Subscribes to pull notifications. |
SubscribeToPullNotificationsOnAllFolders(Int32, String, EventType[]) |
Subscribes to pull notifications on all folders in a user's mailbox. |
SubscribeToPushNotifications(IEnumerable<FolderId>, Uri, Int32, String, EventType[]) |
Initiates a request for a client to receive push notifications. The SubscribeToPushNotifications(IEnumerable<FolderId>, Uri, Int32, String, EventType[]) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2010. |
SubscribeToPushNotifications(IEnumerable<FolderId>, Uri, Int32, String, String, EventType[]) |
Initiates a request to receive push notifications that includes a request for additional information to be returned in the push notification response. The SubscribeToPushNotifications(IEnumerable<FolderId>, Uri, Int32, String, String, EventType[]) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SubscribeToPushNotificationsOnAllFolders(Uri, Int32, String, EventType[]) |
Initiates a request to receive push notifications on all folders in a user's mailbox. The SubscribeToPushNotificationsOnAllFolders(Uri, Int32, String, EventType[]) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2010. |
SubscribeToPushNotificationsOnAllFolders(Uri, Int32, String, String, EventType[]) |
Initiates a request to receive push notifications on all folders in a user's mailbox that includes a request for additional information to be returned in the push notification response. The SubscribeToPushNotificationsOnAllFolders(Uri, Int32, String, String, EventType[]) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
SubscribeToStreamingNotifications(IEnumerable<FolderId>, EventType[]) |
Subscribes to streaming notifications. Calling this method results in a call to Exchange Web Services (EWS). |
SubscribeToStreamingNotificationsOnAllFolders(EventType[]) |
Subscribes to streaming notifications on all folders in a specified user's mailbox. |
SyncFolderHierarchy(FolderId, PropertySet, String) |
Synchronizes the subfolders of a specified folder. |
SyncFolderHierarchy(PropertySet, String) |
Synchronizes the entire folder hierarchy of the mailbox that the specified Web service is connected to. |
SyncFolderItems(FolderId, PropertySet, IEnumerable<ItemId>, Int32, SyncFolderItemsScope, String) |
Synchronizes the items in a specified folder (not supported for use against Office 365 Group mailboxes or Public Folders). |
UninstallApp(String) |
Uninstalls a mail app. The UninstallApp(String) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
UnpinTeamMailbox(EmailAddress) |
Unpins a site mailbox. When a mailbox is unpinned, it is no longer guaranteed to be available offline. The UnpinTeamMailbox(EmailAddress) method is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. |
UpdateDelegates(Mailbox, Nullable<MeetingRequestsDeliveryScope>, DelegateUser[]) |
Updates delegates on a specified mailbox. |
UpdateDelegates(Mailbox, Nullable<MeetingRequestsDeliveryScope>, IEnumerable<DelegateUser>) |
Updates delegates on a specified mailbox. |
UpdateInboxRules(IEnumerable<RuleOperation>, Boolean, String) |
Updates a specified user's Inbox rules by applying the specified operations. |
UpdateInboxRules(IEnumerable<RuleOperation>, Boolean) |
Updates a specified user's Inbox rules by applying the specified operations. |
UpdateItems(IEnumerable<Item>, FolderId, ConflictResolutionMode, Nullable<MessageDisposition>, Nullable<SendInvitationsOrCancellationsMode>, Boolean) |
Updates multiple items in a single EWS call. UpdateItems does not support items that have unsaved attachments. |
UpdateItems(IEnumerable<Item>, FolderId, ConflictResolutionMode, Nullable<MessageDisposition>, Nullable<SendInvitationsOrCancellationsMode>) |
Updates multiple items in a single Exchange Web Services (EWS) call. |
Events
OnResponseHeadersCaptured |
Calls the ResponseHeadersCapturedHandler handler. The OnResponseHeadersCaptured event is applicable for clients that target Exchange Online and versions of Exchange starting with Exchange Server 2013. (Inherited from ExchangeServiceBase) |
OnSerializeCustomSoapHeaders |
Represents the event that is called to enable applications to emit custom SOAP headers in requests that are sent to Microsoft Exchange Server. (Inherited from ExchangeServiceBase) |