Exchange 2010 Auto-Populating Calendar

I want to give everyone OWA and BlackBerry Access to employee's calendars.  However, Blackberry only allows access to calendar owners.  Instead of having everyone own everyone elses calendar I want to create a group calendar that everyone has ownership privlidges too.

I then want to write a script to periodically go run through everyone's personal office calendar and add all of those events to that group calendar.

Any ideas how I can get started to do this?  Moreover, is this even possible?

I have .NET and VBA at my disposal as well.  But perhaps this is a job for Exchange Powershell.

Thanks,
JOe K.
ClaudeWalkerAsked:
Who is Participating?
 
sirakovCommented:
Well, I'm more comfortable reading C# but using Microsoft.Office.Interop.Outlook.Application class, you just take advantage of the exposed methods and like this simulating Outlook.
Have a look here :
http://stackoverflow.com/questions/7335959/what-is-exchange-web-services-better-suited-to-do-than-office-interop
And for an another example :
http://blogs.planetsoftware.com.au/paul/archive/2010/05/19/exchange-web-services-ews-managed-api-ndash-part-1.aspx 
0
 
andytagonistCommented:
Authenticated Users would be a good place to start...
0
 
ClaudeWalkerAuthor Commented:
Hmmm.  Could you elaborate on that?  It seems that authenticated users would be involved with permissions.  Giving permissions will simply allow sharing and not populating.  Maybe I'm missing your point.

Thanks,
JOe K.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
AmitIT ArchitectCommented:
For first query you can create public folder calendar, how? Steps are below

http://support.sherweb.com/Faqs/Show/how-to-create-a-public-calendar-exchange-2010

For second query: Answer is not possible.
0
 
sirakovCommented:
I would go for shared mailbox. With Exchange 2010 SP1+ and his automaping feature, you would have all your users share the same calendar and the shared mailbox automatically added to the users Outlook account.
http://atthedatacenter.wordpress.com/2010/09/28/create-a-shared-mailbox-in-microsoft-exchange-2010-and-add-to-owa/
0
 
sirakovCommented:
I do not really agree with amitkulshrestha.
Public folder calendar its not really good because Free/Busy can not be queried by the Availability service on a public folder.
Also using .NET and exchange web services you could create your query.
http://msdn.microsoft.com/en-us/library/bb408521(v=exchg.140).aspx
here is a description :
http://msdn.microsoft.com/en-us/library/bb204119(v=exchg.140).aspx
...Microsoft Exchange Server 2010 provides Exchange Web Services as an extensibility point for clients that connect to the Exchange server and consume information about user availability, and the manipulation of items that are located in the Exchange data store....
and here is an example :
http://weblogs.asp.net/psperanza/archive/2008/03/18/getting-calendar-items-using-exchange-web-services.aspx
0
 
ClaudeWalkerAuthor Commented:
Cool, I'll look into these solutions.


I have started a VB.NET console app.  I can get it to read all of my calendar events but I haven't figured out the syntax to read a calendar I have permissions with.  I've attached the code incase you can see where I need to change it.
Sub GetAllCalendarItems()

        Dim oApp As Microsoft.Office.Interop.Outlook.Application = New Microsoft.Office.Interop.Outlook.Application()
        Dim mapiNamespace As Microsoft.Office.Interop.Outlook.NameSpace = oApp.GetNamespace("MAPI")

        'works for default
        Dim CalendarFolder As Microsoft.Office.Interop.Outlook.MAPIFolder = mapiNamespace.GetDefaultFolder(Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar)

        'CAN'T FIGURE OUT SHARED

        'Dim oRecip As Microsoft.Office.Interop.Outlook.Recipient = mapiNamespace.CreateRecipient("0076@projecthomewi.org")
        'Dim oRecip As Microsoft.Office.Interop.Outlook.Recipient = mapiNamespace.GetRecipientFromID("0076@projecthomewi.org")
        'Dim CalendarFolder As Microsoft.Office.Interop.Outlook.MAPIFolder = mapiNamespace.GetSharedDefaultFolder(oRecip, Microsoft.Office.Interop.Outlook.OlDefaultFolders.olFolderCalendar)

        Dim outlookCalendarItems As Microsoft.Office.Interop.Outlook.Items = CalendarFolder.Items

        outlookCalendarItems.IncludeRecurrences = True
        Dim apptItem As Microsoft.Office.Interop.Outlook.AppointmentItem

        For Each apptItem In outlookCalendarItems
            Console.WriteLine(apptItem.Subject + " -> " + apptItem.Start.ToLongDateString())
        Next apptItem
        Dim a As String = Console.ReadLine("tests")


    End Sub

Open in new window

0
 
ClaudeWalkerAuthor Commented:
So far I've been able to access EWS using default credentials however, I can't figure out how to access everyone's calendar.


// THIS WORKS

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
                service.UseDefaultCredentials = true;
                //service.Url = new Uri("https://mydomain/EWS/Exchange.asmx");
                service.Url = new Uri
                /*Appointment appointment = new Appointment(service);
                appointment.Subject = "Dentist Appointment";
                appointment.Body = "The appointment is with Dr. Smith.";
                appointment.Start = new DateTime(2012, 1, 3, 9, 0, 0);
                appointment.End = appointment.Start.AddHours(2);
                appointment.Save(SendInvitationsMode.SendToNone);*/

Open in new window

0
 
ClaudeWalkerAuthor Commented:
GOT IT!

I also had to use this cmdlet in EMS:

New-ManagementRoleAssignment –Name:impersonationAssignmentName –Role:ApplicationImpersonation –User:myLogin

Thanks so much,
JOe K.
static void Main(string[] args)
{
try
{

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
service.Url = new Uri("https://myDomain.com/EWS/Exchange.asmx");

service.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, "otherUsersEmail@myDomain.com");
Folder calendar = Folder.Bind(service, WellKnownFolderName.Calendar);

foreach (Item item in calendar.FindItems(new ItemView(100)))
{
Console.WriteLine(item.Subject);
}

Console.ReadLine();    

}
catch (Exception ex)
{
Console.WriteLine("Error: " + ex.Message);
Console.ReadLine();
}

Open in new window

0
 
sirakovCommented:
Actually you solved you issue yourself and it was great learning experience for me as well.
Thanks for sharing!
Good luck in the future!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.