Holiday Calendar and How Import to Mailboxes.

Organizations may create calendar PST files for their organizations or teams. This may include organization / team events, project deadlines, holidays or even birthdays. After entering all of this information into the calendar of a generic mailbox and test calendars. you can then export this calendar to a PST file and name it as HOLIDAYCALENDAR.PST . Now an Exchange Administrator can use the Import-mailbox ( Exchange 2007) or new-mailboximportrequest ( Exchange 2010 ) cmdlet to import this PST into everyone’s mailbox, thus putting all the events on everyone’s calendar.

Adding Holidays to Calendar ?

You can use outlook to add location Specific Holidays to Outlook 2010. If using Outlook 2010, you can open the backstage center, click “Options” and then “Calendar”. Here we find the “Add Holidays. ” button

imageimage

If you need to add additional Holidays to Calendar based on country , go to calendar in your outlook add all day event , and categorize it as Holiday .Alternatively you can edit OUTLOOK.HOL File to insert custom holidays. click Here Add or Remove Holidays to your Calendar.

- Once Holiday calendar is created go back and verify the calendar and add any custom holiday’s if you with to add

Here is a sample :

image 

You can Check the Exchange cmdelt’s to verify the number of items in that calendar.

Get-MailboxFolderStatistics “HolidayCalendar” | ? {$_.name –like “calendar” } | FT Name, ItemsInFolder

image

EXPORT HOLIDAY CALEDAR TO PST .

* By default Users or admins are not granted the permissions to Export and import data To<—>From mailboxes in Exchange 2010 SP1, not even users in the Exchange Organization Administrator role group. Before continue with exporting we need to assign the user or group that we want to grant the necessary permissions to the “Mailbox Import Export” management role.

with out these permissions , import export cmdelts will not work for anyone who is trying to export or import data.

To assign the management role to the Administrator account (not really recomemend. You should grant it to a group really), we would use the following command:

New-ManagementRoleAssignment -Name “Mailbox Import Export Admins Task” –User “Administrator” -Role “Mailbox Import Export”

We can now export the Calendar items of the Import Holidays mailbox to a PST file using the following command:


New-MailboxExportRequest –Mailbox “ImportHolidays” -FilePath \\ Nyc-ex2\PST\HolidayCaledar.pst –IncludedFolders “#Calendar#”

or

New-MailboxExportRequest –Mailbox “ImportHolidays” -FilePath \\ Nyc-ex2\PST\HolidayCaledar.pst –IncludedFolders “Calendar”

image

PRESERVE CALENDAR FOLDER PERMISSIONS:

I have tried and tested with several different methods to preserve calendar folder permissions , I am documenting the simple method to perform this task. Before importing the calendar to all the mailboxes you must preserve existing Calendar folder permissions on all users. 

When you import a holiday calendar all the custom DELEGATE Permissions will be overwritten. you will have to reset the permissions manual .

when you are performing this task for thousands of mailboxes at a time , it would be impossible to find out how many are affected. So first you need to export Calendar Folder Permissions for all users using EXFolders  

A. Steps to Export Calendar permissions from all the mailboxes.

==> Download Exfolders Here Download Exfolders

Bill long From Exchange Team has written excellent post on exporting Calendar permissions for all mailboxes. Let me do the Demo here

open Exfolders and enable for Bulk operations. Go to Tools ==> Custom Bulk Operations

image

since we want to Export Calendar folder permissions , Click OK

image

For more details read the blog post Filtering Output From PFDAVAdmin Or ExFolders  , Click OK

all the permissions are exported

image

 

Once permissions are Exported verify the output file for data. 

IMPORT HOLIDAY CALENDAR TO ALL MAILBOXES

Now you are ready to import Holiday calendar on all mailboxes ,

New-MailboxImportRequest –Mailbox “Dave01” -FilePath \\ Nyc-ex2\PST\HolidayCalendar.PST –IncludedFolders “#Calendar#”

here is an example to perform on the import operation for mailboxes on a specific database

Get-mailbox –Database –DB03 | New-MailboxImportRequest –Mailbox “Dave01” -FilePath \\ Nyc-ex2\PST\HolidayCalendar.PST –IncludedFolders “#Calendar#”

 

image 

 

CHECK STATUS OF IMPORT REQUEST

get-mailboximportrequeststatistics –requestqueue db03 | ft name,targetmailbox,itemstransferred,includefolders,percentcomplete

get-mailboximportrequeststatics

image

With this All the mailboxes should be imported with HolidayCalendar you created , verify import is completed and logon to the mailboxes and confirm the same

IMPORT CALENDAR FOLDER PERMISSIONS

Now you need to restore calendar permissions on to all mailboxes using exfolders. open Exfolders Tools –> Import, select the file exported earlier

image

HolidayCaledar is added to all the mailboxes and permissions are restored

* FUTURE IMPORT OPERATION , PREVENT FROM DUPLICATE HOLIDAY CALENDAR ITEM CREATION

* next time when you have to perform the same operation , you must be very careful . because if you perform mailbox import operation twice on same mailbox you will endup with duplicate calendar items , and only was to fix is Manual cleanup. so you must perform an additional query for mailboxes created since your last import option

First query mailboxes that are created after last import performed , let’s say I performed this action on 12/30/2011 and I need to list all mailboxes created after 12/30/2011.

you can use exchange cmdlet’s to query the them Mailboxes

Get-mailbox | { $_.whenmailboxcreated –gt ‘12/30/2011’} | ft name,whenmailboxcreated –autosize

here is couple of examples 

 image

That will be all for now.

Thanks to Vikas Soundade for his valuable inputs and spending many weekends testing Smile

 

-Manju