该帐户没有权限来冒充的用户(The account does not have permission

2019-07-20 23:16发布

我得到这个错误,而试图accessin资源邮箱。 请任何一个帮助我在此。 我是新来的EWS。

我可以通过OWA(Outlook Web应用程序)来访问资源邮箱。 但我不是,因为它是共享邮箱此邮箱的所有者。

我的代码:

ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;
ExchangeService newExchangeService = new ExchangeService  (ExchangeVersion.Exchange2007_SP1);
newExchangeService.Credentials = new NetworkCredential(username, password, domain);
newExchangeService.AutodiscoverUrl(email-id, RedirectionUrlValidationCallback);

newExchangeService.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, email_which_i_want_to_access);

Folder visitorsFolder = Folder.Bind(newExchangeService, WellKnownFolderName.Inbox);
foreach (Folder childfolder in visitorsFolder.FindFolders(new FolderView(10)))
        {
            Console.WriteLine(childfolder.DisplayName);
        }

Answer 1:

这个问题可能是你没有权限来冒充邮箱,但你可能有代理访问权限。 请参阅我的回答对如何访问邮箱这个类似的问题,当你有代理访问: https://stackoverflow.com/a/9242792/64161



文章来源: The account does not have permission to impersonate the requested user