EWS托管API:用户A是否能够在Windows应用中模拟用户B?

问题描述 投票:0回答:1

我需要确定域UserA(当前运行Windows桌面应用程序)是否有权模拟Exchange中的另一个用户,比如UserB。

我可以尝试做一些像读取UserB的收件箱消息,但我采取了更清洁的方式来做到这一点。

是否无法加载UserA的Exchange角色并查找ApplicationImpersonation或其他内容?

所以设置是这样的:

ExchangeService service = new ExchangeService(exchangeVersion);
service.UseDefaultCredentials = true;
service.AutodiscoverUrl(userEmail);
service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.PrincipalName, UserToImpersonate);

//寻找这样的东西:

if(!service.CanImpersonate(userEmail,UserToImpersonate)){Exception ex = new Exception(userEmail +“can can impersonate”+ UserToImpersonate);抛出前}

exchange-server exchangewebservices impersonation
1个回答
0
投票

如果不使用EWS,则需要使用Exchange命令行管理程序cmdlet https://docs.microsoft.com/en-us/powershell/module/exchange/role-based-access-control/get-managementroleassignment?view=exchange-ps来检查是否为特定用户启用了applicationimpersonation。 EWS是一个邮箱API,您所说的设置是一个管理设置,因此您可以使用EWS做的最好处理异常并提出纠正措施。

© www.soinside.com 2019 - 2024. All rights reserved.