Monitoring logging can be used to log certain actions for mailboxes. This function is particularly useful for mailboxes to which several users have access. For example, it is possible to track which user has replied to a certain mail or who has deleted which mail. Audit logging can also be helpful for normal user mailboxes. Although the audit logs are not usually helpful for error analysis, they can be used to determine what the user has done with a mail.
By default, the mailbox audit logs are deactivated and can be activated for each mailbox. The mailbox audit logs are saved for 90 days in the default setting.
The following actions are logged for mailboxes with activated Mailbox Audit Logging:
Configuring the monitoring logging
To activate mailbox audit logging for a specific mailbox, the following command can be used:
Get-Mailbox frank | Set-Mailbox -AuditEnabled $true
The following command can be used to activate monitoring logging for all mailboxes:
Get-Mailbox -ResultSize Unlimited | Set-Mailbox -AuditEnabled $true
Logging can be switched off for an individual mailbox or for all mailboxes using the following commands:
Get-Mailbox Frank | Set-Mailbox -AuditEnabled $false Get-Mailbox -ResultSize Unlimited | Set-Mailbox -AuditEnabled $false
By default, the retention period for the mailbox audit logs is 90 days; this limit can be adjusted with the following commands (for example, to 180 days for a single mailbox or for all mailboxes):
Get-Mailbox Frank | Set-Mailbox -AuditLogAgeLimit 180 Get-Mailbox -ResultSize Unlimited | Set-Mailbox -AuditLogAgeLimit 180
Depending on the activity of the user and the duration of log storage, the storage requirements of the mailbox increase. The increased space requirement must therefore be taken into account. Before monitoring is activated for all mailboxes, this should initially only be configured for a few mailboxes so that the additional space requirement can be estimated.
Checking the monitoring log
Once logging has been activated, a new folder called "Audits" is created in the user's mailbox. The monitoring events are saved in this folder. The user cannot access the "Audits" folder and it is not displayed in Outlook. The Exchange Management Shell can be used to check whether the folder has been created and whether events have already been saved. The following command can be used for this purpose:
get-mailbox frank | Get-MailboxFolderStatistics | where {$_.name -eq "Audits"} | ft name,itemsinfolder
The screenshot shows that the "Audits" folder was created in the "Frank" mailbox and already contains 5 events. In this way, you can also check the memory requirements of the monitoring log:
get-mailbox frank | Get-MailboxFolderStatistics | where {$_.name -eq "Audits"} | ft name,itemsinfolder,foldersize
Retrieving the logs
For a user to be able to view the monitoring logs, the user must be a member of the AD group "Compliance Management". By default, no user has the right to view the logs. The following command can be used to add a user to the "Compliance Management" group:
Add-RoleGroupMember "Compliance Management" -Member administrator
This process is also possible directly via the Active Directory console or via the Exchange Admin Center.
Often only the monitoring logs for a specific user are required. The quickest way is to display the log directly on the Exchange Management Shell. For a single user, this works with the following command:
Search-MailboxAuditLog frank -ShowDetails -StartDate ((get-date).AddDays(-2)) -EndDate (get-date)
In this case, the events of the last 2 days for the user "Frank" are displayed in the shell:
If required, the events can be filtered accordingly. Here, for example, all events of the last 2 days in which a "HardDelete" was executed (mail deleted with Shift+Delete):
Search-MailboxAuditLog frank -ShowDetails -StartDate ((get-date).AddDays(-2)) -EndDate (get-date) | where {$_.Operation -eq "HardDelete"}
There is also a way to access the monitoring logs in the Exchange Admin Center. In this case, the results are sent to a recipient by email as an XML file. The XML file can then be further processed using PowerShell or other tools.
The logs can be retrieved as follows in the Exchange Admin Center:
You can then define for which users the mailbox monitoring logs are to be exported and who the recipient of the results is:
The delivery of the results by mail and XML file can also be triggered directly from the Exchange Management Shell using the following command:
New-MailboxAuditLogSearch "hans3" -Mailboxes hans,frank -StatusMailRecipients frank@frankysweb.org -StartDate ((get-date).AddDays(-2)) -EndDate (get-date) -ShowDetails
The following screenshot shows a corresponding e-mail and the XML file:
The XML file can then be filtered or further processed using appropriate tools. PowerShell can also be used here:
Hinweis
If the Exchange Server was installed on a "non-English speaking" server, no audit logs are displayed. In this case it helps to change the language to "English - US":
Alle Achtung Franky :)
Ist nicht das erste mal das ich bei Dir (und nicht bei MS!) die Lösung für ein, für mich, aktuelles Problem finde.
Tausend Dank für Deine Mühe den Artikel zu schreiben!
Hallöchen,
ZITAT:
Hinweis
Wenn der Exchange Server auf einem “nicht englisch sprachigem” Server installiert wurde, werden keine Audit Logs angezeigt. Hier hilft es die Sprache auf “English – US” umzustellen:
ich fand diesen Beitrag sehr gut und wollte Ihn umsetzen. Nachdem ich die Einstellungen entsprechend gemacht habe, wurde ein Neustart initiiert. Nach dem Neustart war alles Englisch, okay, nur dann kam folgendes Problem auf.
Es konnten Mails versendet werden, aber es kamen keine mehr an und die queue warteschlange wurde nicht mehr abgearbeitet. Gut das ich vorher einen Snapshot gemacht habe. Denn nach wiederherstellen dieses, funktionierte wieder alles reibunglos.
Gibt es dazu eine Idee??
Liebe Grüsse
Michael
Dann will der Dienst Exchange-Postfachtransportzustellung noch unter dem Account „Netzwerkdienst“ starten. Den gibt es auf einem englischen Server nicht. Von Hand auf „Network Service“ umstellen.
Ahoi,
da Franks Artikel auf Exchange2016 fußt und es bei Ihm wohl möglich ist die Audits zu nutzen, obwohl der Server in Deutsch ist, frage ich mal was da der Unterschied ist.
Ich habe 2010 und 2016 im Einsatz. Ich schreibe die Audits für über 200 Postfächer seit Jahren ( in 2010 ) und nun kann ich unter 2016 ( deutsch ) nicht mehr auf die Logs zugreifen, sehr wohl aber noch über 2010.
Da das Umstellen auf Englisch wohl auch nicht ( immer ) funktioniert, das Problem schon bei EXC2013 existierte, sehe ich Seitens MS nicht die Spur eines Willens das noch zu fixen. Das macht micht echt wieder sprachlos.
Gibt es noch andere Lösungsansätze ?
VG
Volker
Ich habe wie in KB3054391 beschrieben einen meiner 3 Server auf English umgestellt, leider werden mir die Audit logs trotzdem nicht gezeigt obwohl 9 Stück im Ordner Audits sind
Vielen Dank für die Zusammenfassung.
Wird das Auswerten der Logs eigentlich auch protokolliert?
Gruß,
Wolfgang
Hi Frank!
Vielen Dank für den Artikel. Reicht es wenn man nur einen seiner Exchange Server auf Englisch umstellt?
Grüße aus Bielefeld,
Andreas
Hallo Frank,
wieder ein sehr schöner Artikel :-)
Ich habe alles soweit konfiguriert (wir setzten Exchange DAG unter 2013 CU21 ein – Deutsch).
Ich bin unter anderem Mitglied:Organization Management, Compliance Management
Ich bin über Powershell und auch sonst nicht in der Lage die Audits zu lesen:
Ich kann alledings sehen, dass es Einträge Audits gibt.
Meldung der Shell:
Search-MailboxAuditLog : Das anfordernde Konto ist nicht berechtigt, auf das Überwachungsprotokoll zuzugreifen.
In Zeile:1 Zeichen:1
+ Search-MailboxAuditLog -Identity blabla -ShowDetails -StartDate 01/01/2017 -EndD …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Search-MailboxAuditLog], AuditLogAccessDeniedException
+ FullyQualifiedErrorId : [Server=EX1,RequestId=d4bf6723-a22f-4063-b7f7-b7a71e5470c4,TimeStamp=05.07.2018 11:15:06
] [FailureCategory=Cmdlet-AuditLogAccessDeniedException] 4CC2A0FD,Microsoft.Exchange.Management.SystemConfiguratio
nTasks.SearchMailboxAuditLog
Noch einen Tipp, wo ich noch nachbessern muss?
Grüße
Volker
Hallo,
wieder einmal vielen Dank für die äusserst hilfreichen Infos.
Ich wollte auch gleich beim Kunden freudig zur Tat schreiten als ich merkte, dass die interessanten Adressen öffentliche Ordner sind.
Gibt es da etwas vergleichbares zur Protokollierung auf Ordner oder Gesamtebene?
Hallo Henning,
aktuell funktioniert das Audit Logging nicht für öffentliche Ordner. Siehe hier:
https://docs.microsoft.com/en-us/exchange/collaboration/public-folders/faq
„Does mailbox audit logging work against public folders?
No. Not at this time.“
Gruß,
Frank
Hi Frank!
Super interessanter Artikel!
Wie zu erkennen ist, schreibst du als Profi nur sehr Powershell-lastige oder Exchange-lastige Infos.
Das Thema ist für viele Kunden sehr interessant und bisher haben wir keine Software gefunden, die das benutzerfreundlich darstellt – auch microsoftig ist nach deinem Artikel das herausfinden, wer was gelöscht/verschoben/beantwortet hat, sehr aufwändig.
Gibt es dafür nicht ein Programm/Software, die die Auswertung der Protokollierung ermöglicht?
Oder eventuell ist das Anlass für ein Skript, dass eine Protokollierung veranschaulicht?
Datum/Zeit – Benutzer – Benutzer-Aktion mit Email-ID/Betreff
Denkst du, sowas ist sehr schwer zu skripten/zu erstellen?
Lg von einem deiner treuen Fans aus Österreich,
Roman
Hallo Roman,
es gibt spezielle Software für diesen Einsatzzweck. Bei Bedarf kann ich dir Links schicken.
Gruß,
Frank
Hallo Roman
anbei eine Software die Exchange Audits auswerten kann. Wir verwenden vom selben Hersteller das AD Audit und es funktioniert extrem gut.
https://www.manageengine.com/products/exchange-reports/exchange-auditing-overview.html
Hallo Roman
du kannst ja die Daten auch ganz einfach mittels Excel auswerten
$ergebnis = Search-MailboxAuditLog -Identity „user“ -ShowDetails -StartDate 01/01/2017 ….
$ergebnis | export-csv