如何使用 C# 从 Exchange 查找 ActiveSync 属性?

发布于 2024-12-13 14:45:53 字数 437 浏览 6 评论 0原文

我正在尝试从 Exchange 中查找一些 ActiveSync 属性。我发现了一篇很好的文章 显示用于查找此信息的 PowerShell cmdlet。但我正在尝试找到这些信息的实际存储位置。我查看了 中的用户对象ADSI 编辑以查看是否有任何属性是这些值,但情况似乎并非如此。 如何使用 C# 查找此信息?

I'm trying to find some ActiveSync attributes from Exchange. I found a good article that shows a PowerShell cmdlet for finding this information. But I'm trying to find where this information is actually stored. I looked at my user objects in ADSI edit to see if any of the properties would be these values, but this does not seem to be the case.
How do I find this information with C#?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

热风软妹 2024-12-20 14:45:53

要获取特定 ActiveDirectory 对象(即用户)的 ActiveSync 属性,您可以使用
CASMailbox 类。

它有一个采用 ADObject 的构造函数,然后为您提供几个属性,例如 HasActiveSyncDevicePartnership - 您甚至可以更改这些(前提是您需要权限,即)。

编辑 - 根据评论:

CASMailbox 类满足您的所有要求。
例如,ActiveSyncMailboxPolicy 是一个 ADObjectId,可以查询多个属性...
另一个示例ActiveSyncAllowedDeviceIDs,它是一个MultiValuedProperty,您可以查询DeviceID等。

这种访问属性的方式可能不太好,但它肯定会为您提供所有信息...如果你想要一些相当不错的源代码(在本例中可以与 PS 一起使用)请参阅 http://www.java2s.com /Open-Source/CSharp/Web/dotpanel/dotPanel/Providers/HostedSolution/Exchange2007.cs.htm

To get ActiveSync attributes for a specific ActiveDirectory Object (i.e. user) you can use
CASMailbox class.

It has a constructor taking an ADObject and then gives you several properties like HasActiveSyncDevicePartnership - you can even change these (provided you have needed permissions that is).

EDIT - as per comments:

The CASMailbox class has all you ask.
For example ActiveSyncMailboxPolicy which is an ADObjectId which in turn can be queried for several properties...
Another example ActiveSyncAllowedDeviceIDs which is a MultiValuedProperty which you can query for DeviceIDs etc.

This way of accessing the properties might not be nice but it certainly gives you all information... if you want some rather nice source code (which in this case works with PS) see http://www.java2s.com/Open-Source/CSharp/Web/dotpanel/dotPanel/Providers/HostedSolution/Exchange2007.cs.htm

指尖上的星空 2024-12-20 14:45:53

Get-CASMailbox将为您提供基本信息,例如HasActiveSyncDevicePartnerShip。这些属性存储在 Active Directory 中,您可以在个人帐户下使用 adsiedit 查看它们。

如果您需要更多属性,例如 DeviceFriendlyName、LastSuccessSync、DeviceImei,则必须使用 PS Cmdlet Get-MobileDeviceStatistics 从邮箱本身检索它们。

在 C# 代码中使用 PS CmdLets 有多种方法,为了进行交换,您可能需要使用 PS Remoting:https://stackoverflow.com /a/9627716/1984242

Get-CASMailbox will give you basic information such as HasActiveSyncDevicePartnerShip. These properties are stored in active directory, you can view them with adsiedit right under the person account.

If you want more properties like DeviceFriendlyName, LastSuccessSync, DeviceImei, they have to be retrieved from the mailbox itself using the PS Cmdlet Get-MobileDeviceStatistics.

There are several methods to use PS CmdLets inside C# code, for exchange you will probably want to use PS Remoting : https://stackoverflow.com/a/9627716/1984242

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文