?
Solved

Adding appointments to multiple accounts in Exchange

Posted on 2011-03-15
5
Medium Priority
?
301 Views
Last Modified: 2013-12-17
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Exchange.WebServices.Data;

namespace EwsManagedTest
{
    class Program
    {
        static void Main(string[] args)
        {
            ServicePointManager.ServerCertificateValidationCallback +=
            delegate(
                object sender,
                X509Certificate certificate,
                X509Chain chain,
                SslPolicyErrors sslPolicyErrors)
            {
                return true;
            };


            string userName = "login";
            string password = "password";
            string domain = "domain.com";
            string exchangeWebServiceUrl = "https://domain.com/ews/exchange.asmx";
            ExchangeService service = new ExchangeService();
            service.Credentials = new WebCredentials(userName, password, domain);
            service.Url = new Uri(exchangeWebServiceUrl);

            Appointment appointment = new Appointment(service);
            appointment.Subject = "Testing";
            appointment.Start = DateTime.Now;
            appointment.End = appointment.Start.AddHours(1);
            appointment.Save();
            
        }
    }
}

Open in new window


How do I modify this code to add new appointments to exchange calendar for multiple accounts using just one master login credentials?
0
Comment
Question by:joein610
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 74

Assisted Solution

by:Glen Knight
Glen Knight earned 2000 total points
ID: 35142066
Its down to the permissions on the mailbox.  If the user you are authenticating with has access to all the mailboxes then it will be able to create a calendar entry.
0
 

Author Comment

by:joein610
ID: 35147276
How do I mention it in the code? Let's say that my login is xxx and I want to add a calendar item for the user yyy. How do I do that? Do I still log in with the same credentials?

0
 
LVL 74

Accepted Solution

by:
Glen Knight earned 2000 total points
ID: 37419629
Yes, you just create a service account that has access to all the mailboxes and then use this account to create the appointments.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
how to add IIS SMTP to handle application/Scanner relays into office 365.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question