簡體   English   中英

使用服務帳戶訪問其他用戶日歷

[英]Accessing other user calendar using service account

我們正在嘗試使用EWS托管API集成Office 365。 我們已經使用Office 365管理中心創建了一個具有模擬角色的服務帳戶。 現在,我們如何使用該服務帳戶訪問應用程序中其他用戶的數據(如郵件,聯系人,日歷)? 謝謝羅希特

您照常創建ExchangeService的實例,然后設置其ImpersonatedUserId。

樣品:

var credentials = new WebCredentials(
    "impersonateduser@your.onmicrosoft.com", "password", "");

var exchange = new ExchangeService{PreAuthenticate=true, Credentials=credentials};
exchange.ImpersonatedUserId = new ImpersonatedUserId(
    ConnectingIdType.SmtpAddress, 
    "calendaruser@your.onmicrosoft.com");

之后,您可以訪問其他用戶(在本例中為calendaruser )的數據。

http://msdn.microsoft.com/zh-cn/library/office/dn722377(v=exchg.150).aspx及其所有子主題都是一個不錯的起點。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM