将委托与 Exchange Web 服务结合使用

发布于 2024-07-07 04:49:15 字数 96 浏览 6 评论 0原文

有人使用带有 Exchange Web 服务的代表吗? 我希望一名用户能够控制 Exchange 中其他用户的日历。 我发现这个问题有点棘手,我想看看其他人如何让它正常工作。

Has anyone used delegates with exchnage web services? I would like one user to be able to control other users' calendars in Exchange. I'm finding this problem to be a little tricky, and I'd like to see how others have been able to get it to work properly.

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

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

发布评论

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

评论(1

指尖上的星空 2024-07-14 04:49:15

我才刚刚开始,但我设法通过委托帐户访问资源日历。

我使用了本文中有关委托帐户和资源帐户的建议。 (资源帐户很棘手,因为它们在 AD 中被禁用,并且您必须使用委托帐户才能访问它们)

在服务器上设置委托帐户后,我使用委托帐户的凭据设置 ExchangeServerBinding:

ExchangeServiceBinding binding = new ExchangeServiceBinding();
binding.Url = @"https://dc1.litwareinc.com/ews/exchange.asmx";
// Setup binding with username and password of the delegate account
binding.Credentials = 
    new NetworkCredential(delegateuserName, delegatepassword, "litwareinc.com");

我正在使用 Microsoft 准备的虚拟服务器映像进行测试

然后,在访问邮箱时,我设置了 FindItemType 请求并使用我要访问的帐户的 smtp 地址:

// Prepare request
var findItemRequest = new FindItemType();
// Setup the mailbox using the smtp address of the account wanted
var mailbox = new EmailAddressType {EmailAddress = mailboxId};
findItemRequest.ParentFolderIds = 
    new[] {new DistinguishedFolderIdType {Mailbox = mailbox}};
((DistinguishedFolderIdType) findItemRequest.ParentFolderIds[0]).Id = 
    DistinguishedFolderIdNameType.calendar;
findItemRequest.Traversal = ItemQueryTraversalType.Shallow;

// Add ItemResponseShapeType and Calendarview to request here ...

// The create a FindItemResponseType using the binding and the request
var response = binding.FindItem(findItemRequest);

简而言之:

  1. 设置在 Exchange 服务器上具有委托访问权限的帐户,这可以通过 owa 或使用 Exchange Shell 脚本来完成
  2. 在 ExchangeServiceBinding 对象上使用具有委托访问权限的帐户
  3. 使用 FindItemType 将目标帐户 smtp-addres 作为 EmailAddressType

问候
杰斯帕·豪格

I'm just getting started here, but i managed to get access to Resource calendars via a delegate account.

I used the recommendations from this article about delegate account and resource accounts. (Resource accounts are tricky because they are disabled in the AD, and you have to use a delegate account to get access to them)

After setting up the delegate account on the server, I set up the ExchangeServerBinding using the credentials of the delegate account:

ExchangeServiceBinding binding = new ExchangeServiceBinding();
binding.Url = @"https://dc1.litwareinc.com/ews/exchange.asmx";
// Setup binding with username and password of the delegate account
binding.Credentials = 
    new NetworkCredential(delegateuserName, delegatepassword, "litwareinc.com");

(I'm using Microsofts prepared virtual server image for testing)

Then when accessing the mailbox, I set up a FindItemType request and use the smtp address of the account i want to access:

// Prepare request
var findItemRequest = new FindItemType();
// Setup the mailbox using the smtp address of the account wanted
var mailbox = new EmailAddressType {EmailAddress = mailboxId};
findItemRequest.ParentFolderIds = 
    new[] {new DistinguishedFolderIdType {Mailbox = mailbox}};
((DistinguishedFolderIdType) findItemRequest.ParentFolderIds[0]).Id = 
    DistinguishedFolderIdNameType.calendar;
findItemRequest.Traversal = ItemQueryTraversalType.Shallow;

// Add ItemResponseShapeType and Calendarview to request here ...

// The create a FindItemResponseType using the binding and the request
var response = binding.FindItem(findItemRequest);

So in short:

  1. Setup an account with delegate access on the Exchange server, this can be done via owa or with a Exchange Shell script
  2. Use the account with delegate access on the ExchangeServiceBinding object
  3. Access target account using a FindItemType with the target account smtp-addres as EmailAddressType

Regards
Jesper Hauge

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