Share via

Implementation for X-AnchorMailBox (Http Header)

Kumar, Sachitha (Legal) 20 Reputation points
2023-07-31T08:58:46.9333333+00:00

Hi All,

Our product has an issue supporting Multi-geo locations .

Current Behaviour is administrator account , Impersonate User account and delegated account should be in same geo location.

We are implementing X-AnchorMailBox to support Multi -geo locations.

We are using One Administartor mailbox, User and Delegated mailbox are of same tenant, not using group Information.

Can anyone please let me know if my changes are correct.

// Configure the ExchangeService with the access token           
  var service = new ExchangeService(ExchangeVersion.Exchange2007_SP1, timeZone);                     
 service.Url = new Uri(" https://outlook.office365.com/EWS/Exchange.asmx");
 service.Credentials = new OAuthCredentials(Token);                     
 service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, mailBox);  
//Implementation of X-Anchor MailBox
 if (!service.HttpHeaders.ContainsKey("X-AnchorMailbox"))  

 service.HttpHeaders.Add("X-AnchorMailbox", mailBox);   
  
else               
 service.HttpHeaders["X-AnchorMailbox"] = mailBox;
Exchange Online
Exchange Online

A cloud-based service included in Microsoft 365, delivering scalable messaging and collaboration features with simplified management and automatic updates.

Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Exchange | Exchange Server | Development
Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.