I was recently asked to figure out a silent method of adding our organization’s holiday’s to all users calendars. Following was my approach.
First I thought of looking for a client side solution. Everyone in our organization uses Outlook 2007 and outlook uses a file name outlook.hol for holiday configuration. Following is the format of file, it can be created using a simple text editor and can be distributed by an email or commandline (outlook.exe /hol holidayfilename)
[Country or Description] ###
Event or holiday description, yyyy/mm/dd
Event or holiday description, yyyy/mm/dd
read for more details
Above is not very clean for a large environment, so I was not too happy with this solution and started taking a different approach.
Definitely it would be so much easier doing it with Exchange Management Shell and finally I found my answer.
Here is what's needed for a great solution
Get-Mailbox –ResultSize Unlimited | Export-Mailbox –IncludeFolders ‘\Calendar’ –SubjectKeywords “Subject of the appointment” –DeleteContent
Hope this is useful!! Please comment.
First I thought of looking for a client side solution. Everyone in our organization uses Outlook 2007 and outlook uses a file name outlook.hol for holiday configuration. Following is the format of file, it can be created using a simple text editor and can be distributed by an email or commandline (outlook.exe /hol holidayfilename)
[Country or Description] ###
Event or holiday description, yyyy/mm/dd
Event or holiday description, yyyy/mm/dd
read for more details
Above is not very clean for a large environment, so I was not too happy with this solution and started taking a different approach.
Definitely it would be so much easier doing it with Exchange Management Shell and finally I found my answer.
Here is what's needed for a great solution
- Exchange Management Tools and Outlook 2007 installed on a 32bit machine
- Outlook 2007 to create a PST file
- Export-mailbox
- Import-mailbox
- First of all create all events for all holidays in a mailbox Calendar and export it to a PST file or Create a Calendar Item in a PST file with the name “Calendar” and create all events in it.
- On 32bit a machine where outlook 2007 is installed login with an Exchange Enterprise Admin account and open Exchange Management Shell then run the following
$users=Get-Mailbox –ResultSize Unlimited
Import-Mailbox $users –PSTFolderPath c:\pstfolder/pstfile.pst –IncludeFolders ‘\Calendar’
- Above will add all items from the PST File Calendar to all users’ calendars.
Get-Mailbox –ResultSize Unlimited | Export-Mailbox –IncludeFolders ‘\Calendar’ –SubjectKeywords “Subject of the appointment” –DeleteContent
Hope this is useful!! Please comment.
How would you modify the command to use with a particular user instead of all users ($users).
ReplyDeleteDear Michael,
ReplyDeleteu can simply do
import-mailbox username –PSTFolderPath c:\pstfolder/pstfile.pst –IncludeFolders ‘\Calendar’
and
Get-Mailbox username | Export-Mailbox –IncludeFolders ‘\Calendar’ –SubjectKeywords “Subject of the appointment” –DeleteContent
thanks !
ReplyDeleteI hate that I didn't think of this myself!! Awesome find! and Thank you for sharing!
ReplyDeleteThank you!!
ReplyDeleteGreat solution, but what about new users, they still need this import after creation, isn't there a solution, for existing and new users automatically?
ReplyDeleteScheduled tasks with Exchange Management Shell will do the trick. if you don't want to repeat on already updated users, then you can update one of the custom attribute with a string so accounts with that string can be ignored.
DeleteThis comment has been removed by the author.
ReplyDeleteGood post, need the same way for a Exchange 2010 system...
ReplyDeleteNice one
ReplyDeleteDoes it work with Exchange 2010 ?
Do you know how we remove all the old entrys imported through .HOL files ?