为另一个邮箱创建日历项目
我正在尝试使用 CreateItem 为属于我所连接的用户以外的用户的邮箱创建 CalendarItem。我连接的用户没有邮箱。
下面是我的 xml
<CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
SendMeetingInvitations="SendToAllAndSaveCopy" >
<SavedItemFolderId>
<t:DistinguishedFolderId Id="calendar">
<Mailbox>
<EmailAddress>user1@testhost</EmailAddress>
</Mailbox>
</t:DistinguishedFolderId>
</SavedItemFolderId>
<Items>
<t:CalendarItem xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<Subject>Test Calendar Entry</Subject>
<Body BodyType="Text">Test.</Body>
<ReminderIsSet>true</ReminderIsSet>
<ReminderMinutesBeforeStart>60</ReminderMinutesBeforeStart>
<Start>2012-01-20T09:00:00</Start>
<End>2012-01-20T17:00:00</End>
<IsAllDayEvent>false</IsAllDayEvent>
<Location>Test Location</Location>
</t:CalendarItem>
</Items>
</CreateItem>
将其发送到服务器后我收到的回复是:
[消息文本] =>当以没有邮箱的帐户身份发出请求时,您必须为任何可区分的文件夹 ID 指定邮箱主 SMTP 地址。
[响应代码] => ErrorMissingEmailAddress
此外,我可以从具有邮箱的帐户成功运行此 xml(省略邮箱元素),并且它确实创建了日历项目。
我已检查我正在登录的用户是否具有对 user1 邮箱的完全访问权限。
我尝试指定 UPN 而不是主 SMTP。
如果我指定无效或非主要电子邮件地址,我会收到预期的错误,这表明我指定了正确的元素。
预先感谢您的任何提示。
I'm trying to use CreateItem to create a CalendarItem for a Mailbox belonging to a user other than the one I'm connected as. The user I am connecting as does not have a Mailbox.
Below is my xml
<CreateItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"
SendMeetingInvitations="SendToAllAndSaveCopy" >
<SavedItemFolderId>
<t:DistinguishedFolderId Id="calendar">
<Mailbox>
<EmailAddress>user1@testhost</EmailAddress>
</Mailbox>
</t:DistinguishedFolderId>
</SavedItemFolderId>
<Items>
<t:CalendarItem xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
<Subject>Test Calendar Entry</Subject>
<Body BodyType="Text">Test.</Body>
<ReminderIsSet>true</ReminderIsSet>
<ReminderMinutesBeforeStart>60</ReminderMinutesBeforeStart>
<Start>2012-01-20T09:00:00</Start>
<End>2012-01-20T17:00:00</End>
<IsAllDayEvent>false</IsAllDayEvent>
<Location>Test Location</Location>
</t:CalendarItem>
</Items>
</CreateItem>
After sending this to the server the reply I receive is:
[MessageText] => When making a request as an account that does not have a mailbox, you must specify the mailbox primary SMTP address for any distinguished folder Ids.
[ResponseCode] => ErrorMissingEmailAddress
Additionally, I can successfully run this xml from an account with a mailbox (omitting the mailbox element) and it does create the Calendar item.
I've checked the user I'm logging in as does have full access to user1's mailbox.
I've tried specifying the UPN instead of the primary SMTP.
If I specify an invalid or non-primary email address, I get the expected errors, which indicates I am specifying the correct element.
Thanks in advance for any hints.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在对日历项进行任何操作之前,您必须冒充其他用户
You have to impersonate as other user before do any operation on the calendar item
模拟的一个问题是,如果您使用的是 2007 Exchange Server,则您对应用于模拟用户的角色的粒度没有太多控制权。 Exchange Server 2010 通过基于角色的模拟解决了这个问题。如果您拥有庞大的用户群,您可能需要考虑逐步采用它。
我认为标准行为是创建一个服务帐户,该帐户对您感兴趣的组/人员具有模拟权限。这种方法最大限度地减少了需要授予模拟权限的用户数量,并且还允许您控制访问权限这一切都通过您的 API
Exchange 允许您获得此行为的另一种方式是通过委派,当然只能通过 Outlook UI。
An issue with impersonation, well if your on the 2007 Exchange Server, is that you don't have much control on the granularity of roles applied to the impersonating user. Exchange server 2010 addresses this with role based impersonation. You may want to look at phasing it in if you have a large user base.
I think the standard behavior is to create a service account which would have the impersonation rights on the groups/people your interested in. This approach minimizes the number of users who need to be granted the impersonation rights and also allows you to control the access as its all through your API
The other way Exchange allows you to get this behavior is through delegation of course that is only through the Outlook UI.