该帐户无权模拟所请求的用户 [英] The account does not have permission to impersonate the requested user

查看:293
本文介绍了该帐户无权模拟所请求的用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试访问资源邮箱时出现此错误.请有人帮助我.我是EWS的新手.

I am getting this error while try to accessin the resource mailbox. pls any one help me on this . I am new to EWS.

我能够通过OWA(Outlook Web App)访问资源邮箱.但是我不是此邮箱的所有者,因为它是共享邮箱.

I am able to access the resource mailbox through OWA(Outlook web app). But i am not owner of this mailbox as it is shared mailbox.

我的代码:

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);
        }

推荐答案

问题可能是您没有模拟邮箱的权限,但可能具有委托访问权限.请查看我对类似问题的回答,以了解在具有代理访问权限时如何访问邮箱: https://stackoverflow.com/a/9242792/64161

The problem could be that you do not have permissions to impersonate the mailbox but you may have delegate access. Please see my answer to this similar question on how to access a mailbox when you have delegate access: https://stackoverflow.com/a/9242792/64161

这篇关于该帐户无权模拟所请求的用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆