简体   繁体   English

如何在C#中使用ews获取邮箱属性(类似于Get-Mailbox run cmdlet的输出,但使用ews)

[英]How to obtain properties of mailbox using ews in C# (similar to the output of Get-Mailbox run cmdlet but using ews)

We want to get all the properties of a particular mailbox in some form of collection object using EWS in C# application that is running remotely and then write these properties to a flat file for troubleshooting/support. 我们希望使用在远程运行的C#应用​​程序中的EWS以某种形式的收集对象获取特定邮箱的所有属性,然后将这些属性写入平面文件以进行故障排除/支持。

EWS connection is thru impersonate authentication who has admin rights on the mailbox for which we want to fetch the properties. EWS连接是通过模拟身份验证,该身份验证在我们要为其获取属性的邮箱上具有管理员权限。

Basically we want to fetch all the properties listed in the below link for a mailbox remotely using ews. 基本上,我们希望使用ews远程获取邮箱的以下链接中列出的所有属性。 https://docs.microsoft.com/en-us/previous-versions/office/developer/exchange-server-2010/ff328629(v%3dexchg.140) https://docs.microsoft.com/zh-cn/previous-versions/office/developer/exchange-server-2010/ff328629(v%3dexchg.140)

How can I obtain these using EWS in C# ? 如何在C#中使用EWS获得这些内容?

We could use the ResolveName () method to get mailboxes, for example: 我们可以使用ResolveName ()方法获取邮箱,例如:

var mailboxes = ews.ResolveName(email);
if (mailboxes.Any()) {
    var mailbox = mailboxes.First();
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM