A reader of my site asked me if there is a way to receive an overview of a calendar by e-mail. The background was that a vacation calendar was maintained within the department, which was an Exchange resource mailbox in which each team member entered their vacation. The requirement was to receive an overview of this calendar for the next 4 weeks by e-mail.
For this small requirement I have created a PowerShell script that uses the Exchange EWS API and reads the calendar and sends the entries as a table in a mail. This is what a mail looks like:
The script is now simply started every Monday morning via a scheduled task and then sends the mail. If someone has similar requirements, the script can be adapted accordingly. The download link can be found at the end of the article.
The EWS API 2.2 is required, which can be downloaded here:
The script can be downloaded here:
The script still needs to be adapted to your own environment, but I think this is self-explanatory. As a rule, it will probably be sufficient to adapt the first 9 lines in the script. If a longer period is required (default 28 days), this can be adjusted in line 38. A maximum of 200 entries are listed in the overview (line 40).
The script can then be started at a selected time via task scheduling:
Questions or suggestions for improvement are welcome by e-mail.
In unserer Exchange 2016 Umgebung bekomme ich die Meldung „The Autodiscover service couldn’t be located.“
Ist das Skript nur für Ex2010 geeignet?
Da keine Antwort auf das o.g. Problem kam, auch nochmal die FRage von mir: Ich bekomme die gleiche Meldung. „The Autodiscover service couldn’t be located.“ Wir haben einen Exchange 2019 CU9 installiert.
Top, Mathias, danke!
@Bernhard Diener:
@{N=’Betreff‘;E={$_.Subject}}
Ich habe das Script bereits auf meine Bedürnisse angepasst, sharing is caring:
#HTML Table für die Mail vorbereiten
$htmltable = $results | select -property @{N=’Termin‘;E={$_.Subject}}, @{N=’Ort‘;E={$_.Location}}, @{N=’Kategorien‘;E={$_.Categories}}, @{N=’Start‘;E={get-date $_.Start -format ‚dd.MM.yyyy HH:mm‘}}, @{N=’Ende‘;E={get-date $_.End -format ‚dd.MM.yyyy HH:mm‘}} | convertto-html -Head $CSS -Title $Title -body $Body
Zeigt Betreff, Ort, Kategorien, Start und Ende an.
Nutze es für einen gemeinsamen Kalender, wo mit den Outlook Kategorien gearbeitet wird.
Super Sache.
Kann man auch eine Spalte mit dem Betreff anzeigen lassen? Wenn ja, wie?
Z.B. „Urlaub auf Malle“ ;-)
Wäre das auch mit Kalendern aus Öffentlichen Ordnern möglich da Wir „leider“ dort die meisten Gruppenkalender gespeichert haben?
Hallo Paul,
grundsätzlich kannst du auch per EWS auf Kalender in öffentlichen Ordnern zugreifen. Du musst nur das Script leicht abwandeln, dann funktioniert es auch mit Öffentlichen Ordern.
Gruß,
Frank
Feine Sache – bei uns haben viele Kunden genauso einen Urlaubskalender oder anderen Planer (z.B. Werkstattplaner für KFZ Fuhrpark o.ä.) im Exchange. Ich denke da gibt es bestimmt noch Nutznießer.
Super Frank :).
Ich liebe deine Artikel!