Exchange – MessageTrackingLogs: Fehler beim Schreiben von Protokollen…Ereignis-ID 6004

Ändert man den Pfad für die Log-Dateien und vergisst für das Verzeichnis die Rechte für den „Netzwerkdienst“ bzw. „Network System“ zu setzen, fehlen die nötigen Rechte zum Schreiben in das Verzeichnis.

Im Eventlog taucht dies wie folgt auf.

Ereignis-ID 6004

MessageTrackingLogs: Fehler beim Schreiben von Protokollen aufgrund von Fehler: Der Zugriff auf den Pfad „MSGTRK2022042514-1.LOG“ wurde verweigert..

So sollte die Rechtevergabe aussehen

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

Write-Output "Removing Windows 10 Mail Appx Package"
Get-AppxPackage Microsoft.windowscomminicationsapps | Remove-AppxPackage
Get-AppxPackage Microsoft.windowscomminicationsapps | Remove-AppxPackage -Allusers
if(Get-AppxPackage -Name Microsoft.windowscommunicationsapps -AllUsers){
Get-AppxPackage -Name Microsoft.windowscommunicationsapps -AllUsers | Remove-AppxPackage -AllUsers - Verbose -ErrorAction Continue
}
else{
Write-Output "Mail app is not installed for any user"
}
if(Get-ProvisionedAppxPackage -Online | Where-Object {$.Displayname -match "Microsoft.windowscommunicationsapps"}){
Get-ProvisionedAppxPackage -Online |Where-Object {$.DisplayName -Match "Microsoft.windowscommunicationsapps"} | Remove-AppxProvisionedPackage -Online -AllUsers -Verbose -ErrorAction Continue
}
else {
Write-Output "Mails app is not installed for the system"
}