![](/img/trans.png)
[英]Exchange Web Services - accessing calendar of group mailbox using service account
[英]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
)的數據。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.