Solved

Adding appointments to multiple accounts in Exchange

Posted on 2011-03-15
5
293 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
  • 2
5 Comments
 
LVL 74

Assisted Solution

by:Glen Knight
Glen Knight earned 500 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 500 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

Free book by J.Peter Bruzzese, Microsoft MVP

Are you using Office 365? Trying to set up email signatures but you’re struggling with transport rules and connectors? Let renowned Microsoft MVP J.Peter Bruzzese show you how in this exclusive e-book on Office 365 email signatures. Better yet, it’s free!

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Learn to move / copy / export exchange contacts to iPhone without using any software. Also see the issues in configuration of exchange with iPhone to migrate contacts.
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…
This video discusses moving either the default database or any database to a new volume.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now