This documentation is archived and is not being maintained.

UpdateDelegateType Class

The UpdateDelegateType class represents a request to update delegate settings on a mailbox.

Namespace: ExchangeWebServices
Assembly: EWS (in ews.dll)

[GeneratedCodeAttribute("wsdl", "2.0.50727.42")] 
public class UpdateDelegateType : BaseDelegateType
/** @attribute SerializableAttribute() */ 
/** @attribute DebuggerStepThroughAttribute() */ 
/** @attribute DesignerCategoryAttribute("code") */ 
/** @attribute XmlTypeAttribute(Namespace="") */ 
/** @attribute GeneratedCodeAttribute("wsdl", "2.0.50727.42") */ 
public class UpdateDelegateType extends BaseDelegateType
GeneratedCodeAttribute("wsdl", "2.0.50727.42") 
public class UpdateDelegateType extends BaseDelegateType

The following example shows you how to update delegate permissions on user1's account. User2 is granted the None permission level for the Calendar folder and is granted permission to view private items. User3 is granted Reviewer permissions for the Journal folder. Meeting requests are sent to the delegates and information about the request is sent to user1.

static void UpdateDelegate()
    // 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";

    // Create the request.
    UpdateDelegateType request = new UpdateDelegateType();

    // Identify the mailbox for which delegate settings will be updated.
    request.Mailbox = new EmailAddressType();
    request.Mailbox.EmailAddress = "";

    // Update delegate user permissions for user2.
    request.DelegateUsers = new DelegateUserType[3] { new DelegateUserType(), new DelegateUserType(), new DelegateUserType() };
    request.DelegateUsers[0].UserId = new UserIdType();
    request.DelegateUsers[0].UserId.PrimarySmtpAddress = "";
    request.DelegateUsers[0].DelegatePermissions = new DelegatePermissionsType();
    request.DelegateUsers[0].DelegatePermissions.CalendarFolderPermissionLevel = DelegateFolderPermissionLevelType.None;
    request.DelegateUsers[0].DelegatePermissions.CalendarFolderPermissionLevelSpecified = true;
    request.DelegateUsers[0].ViewPrivateItems = true;
    request.DelegateUsers[0].ViewPrivateItemsSpecified = true;

    // Update delegate user permissions.
    request.DelegateUsers[1].UserId = new UserIdType();
    request.DelegateUsers[1].UserId.PrimarySmtpAddress = "";
    request.DelegateUsers[1].DelegatePermissions = new DelegatePermissionsType();
    request.DelegateUsers[1].DelegatePermissions.JournalFolderPermissionLevel = DelegateFolderPermissionLevelType.Reviewer;
    request.DelegateUsers[1].DelegatePermissions.JournalFolderPermissionLevelSpecified = true;

    // Identify how meeting requests are handled.
    request.DeliverMeetingRequests = new DeliverMeetingRequestsType();
    request.DeliverMeetingRequests = DeliverMeetingRequestsType.DelegatesAndSendInformationToMe;
    request.DeliverMeetingRequestsSpecified = true;

        // Send the UpdateDelegate request and get the response.
        UpdateDelegateResponseMessageType response = esb.UpdateDelegate(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 updated: " + resp.DelegateUser.UserId.DisplayName);
            else if (resp.ResponseClass == ResponseClassType.Error)
                Console.WriteLine("Error: " + resp.MessageText);
                Console.WriteLine("Warning: " + resp.MessageText);
    catch (Exception e)

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows XP Professional with Service Pack 2 (SP2), Windows Server 2003,

Target Platforms

Windows 98, Windows 2000, Windows 2000 Server, Windows CE, Windows Longhorn, Windows 98 Second Edition, Pocket PC, Smart Phone, Windows Server 2003, Windows XP Professional with Service Pack 2 (SP2)