How to share schedules using the ews protocol

two mows 0 Reputation points
2024-07-19T01:52:52.9166667+00:00

How to share schedules using the ews protocol

Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,598 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Hu-MSFT 3,275 Reputation points Microsoft Vendor
    2024-07-19T08:48:06.52+00:00

    Hi,Welcome to the Microsoft Q&A forum.

    Here’s a overview of how you can do that:1. Set up EWS Managed API: First, you need to install and set up the EWS Managed API. You can download it from the Microsoft website or use NuGet to install it into your project.

    1. Authenticate: Establish a connection to the Exchange server using proper authentication credentials.
    2. Create and Send Sharing Invitation:
      • Create a Calendar Folder: If you don't already have a calendar folder to share, you can create one.
      • Create Sharing Invitation: Use the CreateSharingInvitation method to generate a sharing invitation for the calendar.
      • Send Sharing Invitation: Send the sharing invitation to the intended recipient.

    Here is a basic example in C#:

    
    using Microsoft.Exchange.WebServices.Data;
    
    class Program
    
    {
    
        static void Main(string[] args)
    
        {
    
            ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
    
            service.Credentials = new WebCredentials("your_username", "your_password", "your_domain");
    
            service.Url = new Uri("https://your_exchange_server/EWS/Exchange.asmx");
    
            // Create a calendar folder
    
            Folder calendarFolder = new Folder(service);
    
            calendarFolder.DisplayName = "Shared Calendar";
    
            calendarFolder.FolderClass = "IPF.Appointment";
    
            calendarFolder.Save(WellKnownFolderName.Calendar);
    
            // Create a sharing invitation
    
            FolderPermission permission = new FolderPermission("recipient_email@example.com", FolderPermissionLevel.Reviewer);
    
            calendarFolder.PermissionSet.Permissions.Add(permission);
    
            // Send sharing invitation
    
            CalendarFolder calendar = CalendarFolder.Bind(service, WellKnownFolderName.Calendar);
    
            calendar.Save();
    
            Console.WriteLine("Sharing invitation sent.");
    
        }
    
    }
    
    

    Replace placeholders like "your_username", "your_password", "your_domain", and "your_exchange_server" with your actual Exchange server details and credentials.

    Please feel free to contact me for any updates.And if this helps,don't forget to mark it as an answer.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.