Exercise 1: Working with Calendar Items
Task 1 – Beginning the Lab
In this task, you will open the project and configure it to run with your accounts.
Task 2 – Establishing a connection to the Exchange Server
In this task, you will create an ExchangeService object and connect to the correct Exchange CAS Server using your default credentials and your primary lab user ID.
Task 3 – Creating Items
In this task, you will create an appointment, set properties to add an attendee, set a recurrence pattern, save the appointment, and send the invitation.
Task 4 – Finding Items
In this task, you will search the primary lab user’s calendar for appointments occurring in the next five days.
Task 5 – Impersonation
Task Setup RequirementsIn order to complete the this lab, you’ll need to grant the ApplicationImpersonation role to the primary lab user account over the secondary lab user account.Open the Exchange Management Shell as an administrator on the Exchange Server and run the following command where -Name is a unique name for the role, -User is the primary lab user Id, and -RecipientOrganizationalUnitScope is the organizational unit containing the secondary lab user account.New-ManagementRoleAssignment –Name “Impersonation-SeanChai” –Role “ApplicationImpersonation” –User sc –RecipientOrganizationalUnitScope fabrikam.com\OUs\Users\SalesFollow this link for more information http://msdn.microsoft.com/en-us/library/bb204095.aspx
In this task, you will set the Exchange Service to impersonate the secondary lab user and create an appointment using their credentials.
In this lab, you used the EWS Managed API to build simple applications that leverage Exchange 2010 data and business logic. You saw how easy it is to get started with the EWS Managed API by showing the simplicity of connecting to the correct Exchange CAS server, working with mailbox items, finding mailbox items, and impersonating an Exchange user.