问题描述
有没有人使用代理与exchnage Web服务?我希望一个用户能够在Exchange中控制其他用户的日历。我发现这个问题有点棘手,我想看看别人如何才能正常工作。我刚刚开始在这里,但我设法通过委托帐户访问资源日历。 >
我使用了。 (资源帐户很棘手,因为它们在AD中被禁用,您必须使用委托帐户才能访问它们)
在服务器,我使用委托帐户的凭据设置ExchangeServerBinding:
ExchangeServiceBinding binding = new ExchangeServiceBinding();
binding.Url = @https://dc1.litwareinc.com/ews/exchange.asmx;
//使用委托帐户的用户名和密码设置绑定
binding.Credentials =
new NetworkCredential(delegateuserName,delegatepassword,litwareinc.com);
(我正在使用Microsoft准备的虚拟服务器映像进行测试)
然后当访问邮箱时,我设置了一个FindItemType请求,并使用我想要访问的帐户的smtp地址:
//准备请求
var findItemRequest = new FindItemType();
//使用所需帐户的smtp地址设置邮箱
var mailbox = new EmailAddressType {EmailAddress = mailboxId};
findItemRequest.ParentFolderIds =
new [] {new DistinguishedFolderIdType {Mailbox = mailbox}};
((DistinguishedFolderIdType)findItemRequest.ParentFolderIds [0])。Id =
DistinguishedFolderIdNameType.calendar;
findItemRequest.Traversal = ItemQueryTraversalType.Shallow;
//添加ItemResponseShapeType和Calendarview来请求这里...
//使用绑定和请求创建一个FindItemResponseType
var response = binding.FindItem (findItemRequest);
简而言之:
- 在Exchange服务器上设置具有委托访问权限的帐户,可以通过owa或Exchange Shell脚本完成
- 在ExchangeServiceBinding对象上使用具有委托访问权限的帐户
- 使用目标帐户smtp-addres的FindItemType访问目标帐户作为EmailAddressType
b $ b Jesper Hauge
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.
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:
- Setup an account with delegate access on the Exchange server, this can be done via owa or with a Exchange Shell script
- Use the account with delegate access on the ExchangeServiceBinding object
- Access target account using a FindItemType with the target account smtp-addres as EmailAddressType
RegardsJesper Hauge
这篇关于使用代理与Exchange Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!