{"id":1361,"date":"2014-10-23T00:18:45","date_gmt":"2014-10-23T00:18:45","guid":{"rendered":"http:\/\/pariswells.com\/blog\/?p=1361"},"modified":"2017-08-02T22:43:30","modified_gmt":"2017-08-02T22:43:30","slug":"batch-import-public-holidays-into-all-users-mailboxes-with-exchange-ews-powershell","status":"publish","type":"post","link":"https:\/\/pariswells.com\/blog\/code\/batch-import-public-holidays-into-all-users-mailboxes-with-exchange-ews-powershell","title":{"rendered":"Batch Import Public Holidays into All Users Mailboxes with Exchange EWS Powershell"},"content":{"rendered":"<p>I based this script off of one referenced here : <a href=\"http:\/\/blogs.msdn.com\/b\/emeamsgdev\/archive\/2012\/10\/29\/outlook-code-importing-bank-holidays-from-an-outlook-hol-based-csv-file.aspx?CommentPosted=true#commentmessage\">http:\/\/blogs.msdn.com\/b\/emeamsgdev\/archive\/2012\/10\/29\/outlook-code-importing-bank-holidays-from-an-outlook-hol-based-csv-file.aspx?CommentPosted=true#commentmessage<\/a><\/p><p>CSV Format<\/p><p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft wp-image-2255 size-full img-responsive\" src=\"http:\/\/pariswells.com\/blog\/wp-content\/uploads\/2014\/10\/6011.image_thumb_6A014D4E1.png\" alt=\"6011-image_thumb_6a014d4e1\" width=\"354\" height=\"596\" srcset=\"https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2014\/10\/6011.image_thumb_6A014D4E1.png 354w, https:\/\/pariswells.com\/blog\/wp-content\/uploads\/2014\/10\/6011.image_thumb_6A014D4E1-178x300.png 178w\" sizes=\"auto, (max-width: 354px) 100vw, 354px\" \/><\/p><p>However I modified Adding a Category to the item,\u00a0as well as adding this to All Users of a AD Group recursively instead of a single user. This will add a list of Holidays to Users Calendars across an organisation. If run again it will not import duplicates and have fields there to delete the duplicate Calendar enteries if needed<\/p><p>The user running this will need the impersonation role setup\u00a0see <a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/ff793352(v=office.14).aspx\">this<\/a> :<\/p><p>New users can then have an email sent to them automatically ( <a href=\"http:\/\/blogs.technet.com\/b\/sukum\/archive\/2013\/04\/03\/send-welcome-email-to-new-mailbox-users.aspx\">http:\/\/blogs.technet.com\/b\/sukum\/archive\/2013\/04\/03\/send-welcome-email-to-new-mailbox-users.aspx<\/a> ) with a .HOL file to run ( P.S. The XML did not work in this , I have to add Lines 6-8 from this <a href=\"http:\/\/itnuts.wordpress.com\/2013\/09\/03\/exchange-2010-automatic-welcome-message-for-a-new-user\/\">http:\/\/itnuts.wordpress.com\/2013\/09\/03\/exchange-2010-automatic-welcome-message-for-a-new-user\/<\/a>)<\/p><pre><br \/><a href=\"https:\/\/github.com\/pariswells\/pariswells.com\/blob\/master\/saveappointmentintoalluserscalendar.ps1\">https:\/\/github.com\/pariswells\/pariswells.com\/blob\/master\/saveappointmentintoalluserscalendar.ps1<\/a><\/pre>","protected":false},"excerpt":{"rendered":"<p>I based this script off of one referenced here : http:\/\/blogs.msdn.com\/b\/emeamsgdev\/archive\/2012\/10\/29\/outlook-code-importing-bank-holidays-from-an-outlook-hol-based-csv-file.aspx?CommentPosted=true#commentmessageCSV FormatHowever I modified Adding a Category to the item,\u00a0as well as adding this to All Users [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[320],"tags":[827,828,710,829,764,826,560,576],"class_list":["post-1361","post","type-post","status-publish","format-standard","hentry","category-code","tag-bank-holidays","tag-batch-import","tag-calendar","tag-delete-calendar-enteries","tag-ews","tag-holidays","tag-outlook","tag-powershell"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/1361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/comments?post=1361"}],"version-history":[{"count":9,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/1361\/revisions"}],"predecessor-version":[{"id":2670,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/posts\/1361\/revisions\/2670"}],"wp:attachment":[{"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/media?parent=1361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/categories?post=1361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pariswells.com\/blog\/wp-json\/wp\/v2\/tags?post=1361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}