RemoveDelegateType 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
类 RemoveDelegateType 表示从邮箱中删除委托的请求。
public ref class RemoveDelegateType : ExchangeWebServices::BaseDelegateType
public class RemoveDelegateType : ExchangeWebServices.BaseDelegateType
Public Class RemoveDelegateType
Inherits BaseDelegateType
- 继承
示例
以下示例演示如何从 user1 的邮箱中删除两个委托。 在此示例中,通过使用委托的主要简单邮件传输协议 (SMTP) 地址删除一个委托,另一个则通过使用委托的安全标识符 (SID) 删除。
static void RemoveDelegate()
{
// Set the version, credentials, and the Client Access server on ExchangeServiceBinding.
ExchangeServiceBinding esb = new ExchangeServiceBinding();
esb.RequestServerVersionValue = new RequestServerVersion();
esb.RequestServerVersionValue.Version = ExchangeVersionType.Exchange2007_SP1;
esb.Credentials = new NetworkCredential("username", "password", "domain");
esb.Url = "https://FQDN/ews/exchange.asmx";
// Identify the delegates to be removed.
UserIdType delegateUser1 = new UserIdType();
UserIdType delegateUser2 = new UserIdType();
delegateUser1.PrimarySmtpAddress = "user2@example.com";
delegateUser2.SID = "S-1-5-21-1333220396-2200287332-232816053-1123";
UserIdType[] delegateUsers = new UserIdType[2] { delegateUser1, delegateUser2 };
// Form the RemoveDelegate request.
RemoveDelegateType request = new RemoveDelegateType();
request.Mailbox = new EmailAddressType();
request.Mailbox.EmailAddress = "user1@example.com";
request.UserIds = delegateUsers;
try
{
// Send the RemoveDelegate request and get the response.
RemoveDelegateResponseMessageType response = esb.RemoveDelegate(request);
DelegateUserResponseMessageType[] durmt = new DelegateUserResponseMessageType[] { };
durmt = response.ResponseMessages;
// Check each response message.
foreach (DelegateUserResponseMessageType resp in durmt)
{
if (resp.ResponseClass == ResponseClassType.Success)
{
Console.WriteLine("Delegate user was removed.");
}
else if (resp.ResponseClass == ResponseClassType.Error)
{
Console.WriteLine("Delegate user was not removed, due to error: " + resp.MessageText);
}
else
{
Console.WriteLine("Warning: " + resp.MessageText);
}
}
Console.ReadLine();
}
catch (Exception e)
{
Console.WriteLine(e.Message);
Console.ReadLine();
}
}
构造函数
| RemoveDelegateType() |
构造 RemoveDelegateType 函数初始化 类的新实例 RemoveDelegateType 。 |
属性
| Mailbox |
属性 Mailbox 获取或设置一个 EmailAddressType 对象,该对象表示已启用邮件的 Active Directory 目录服务对象。 (继承自 BaseDelegateType) |
| UserIds |
属性 UserIds 获取或设置一个 UserIdType 数组,该数组表示要从邮箱中删除的委托。 |