Solved

Adding appointments to multiple accounts in Exchange

Posted on 2011-03-15
5
296 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
In this video we show how to create a User Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Mailb…
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…

805 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