ExchangeServiceBase.Credentials ExchangeServiceBase.Credentials ExchangeServiceBase.Credentials Property


Gets or sets the credentials that are used to authenticate with Exchange Web Services (EWS).

 property Microsoft::Exchange::WebServices::Data::ExchangeCredentials ^ Credentials { Microsoft::Exchange::WebServices::Data::ExchangeCredentials ^ get(); void set(Microsoft::Exchange::WebServices::Data::ExchangeCredentials ^ value); };
public Microsoft.Exchange.WebServices.Data.ExchangeCredentials Credentials { get; set; }
Public Property Credentials As ExchangeCredentials
Property Value

The credentials that are used to authenticate with EWS.


Setting the Credentials property automatically sets the UseDefaultCredentials property to false.

Caution: Be careful not to change the Credentials property after the ExchangeService object has been bound to the Web service. Changing the credentials will cause subsequent Web service operations to fail. To change the Credentials property on the ExchangeService object, you must create a new instance of the ExchangeService object with the credentials that you want.You cannot use the default credentials of the logged on user if the user’s mailbox is hosted in Exchange Online or Exchange Online as part of Office 365. The user’s credentials must be in user principal name (UPN) form for Exchange Online.

Applies to