{"id":5932,"date":"2025-07-01T08:16:19","date_gmt":"2025-07-01T06:16:19","guid":{"rendered":"https:\/\/www.msb365.blog\/?p=5932"},"modified":"2025-07-01T08:16:19","modified_gmt":"2025-07-01T06:16:19","slug":"exchange-online-journaling-reporting","status":"publish","type":"post","link":"https:\/\/www.msb365.blog\/?p=5932","title":{"rendered":"Exchange Online Journaling &#038; Reporting"},"content":{"rendered":"<p>Journaling on Exchange (on-premise) is a feature that is often needed, especially for companies that have an obligation to the authorities to comply with the retention obligation.<br \/>\nWith Exchange online this is a little more difficult. 3rd party tools should be used for this, as native journaling is not intended.<br \/>\nI have developed a solution for this using PowerShell. To be more precise, there are 2 scripts which can be used accordingly.<\/p>\n<p>The two scripts are described below in this article and can be downloaded and used free of charge from GitHub.<\/p>\n<p>As always, although I have tested and used the script several times, I cannot and will not accept any liability for the use of this script.<br \/>\nReaders who download the script are free to customize it according to their needs. Commercial use is allowed, but monetarization requires my explicit permission.<\/p>\n<p>I hope that this solution can help you in your daily work.<\/p>\n<style>\n        \/* Modern WordPress-compatible styling *\/<br \/>        .ej-docs {<br \/>            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;<br \/>            line-height: 1.6;<br \/>            color: #333;<br \/>            max-width: 1200px;<br \/>            margin: 0 auto;<br \/>            padding: 20px;<br \/>        }<\/p>\n<p>        .ej-docs h1 {<br \/>            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);<br \/>            color: white;<br \/>            padding: 30px;<br \/>            border-radius: 12px;<br \/>            text-align: center;<br \/>            margin-bottom: 30px;<br \/>            font-size: 2.5em;<br \/>            font-weight: 300;<br \/>            box-shadow: 0 8px 32px rgba(0,0,0,0.1);<br \/>        }<\/p>\n<p>        .ej-docs h2 {<br \/>            color: #0073aa;<br \/>            border-bottom: 3px solid #0073aa;<br \/>            padding-bottom: 10px;<br \/>            margin-top: 40px;<br \/>            font-size: 1.8em;<br \/>            display: flex;<br \/>            align-items: center;<br \/>            gap: 10px;<br \/>        }<\/p>\n<p>        .ej-docs h3 {<br \/>            color: #444;<br \/>            margin-top: 30px;<br \/>            font-size: 1.4em;<br \/>            border-left: 4px solid #0073aa;<br \/>            padding-left: 15px;<br \/>        }<\/p>\n<p>        .ej-docs h4 {<br \/>            color: #555;<br \/>            margin-top: 25px;<br \/>            font-size: 1.2em;<br \/>        }<\/p>\n<p>        \/* Feature badges *\/<br \/>        .feature-badges {<br \/>            display: grid;<br \/>            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));<br \/>            gap: 20px;<br \/>            margin: 30px 0;<br \/>        }<\/p>\n<p>        .feature-card {<br \/>            background: linear-gradient(135deg, #f8f9fa, #e9ecef);<br \/>            border: 1px solid #dee2e6;<br \/>            border-radius: 10px;<br \/>            padding: 25px;<br \/>            box-shadow: 0 4px 15px rgba(0,0,0,0.05);<br \/>            transition: transform 0.3s ease, box-shadow 0.3s ease;<br \/>        }<\/p>\n<p>        .feature-card:hover {<br \/>            transform: translateY(-5px);<br \/>            box-shadow: 0 8px 25px rgba(0,0,0,0.1);<br \/>        }<\/p>\n<p>        .feature-card h4 {<br \/>            color: #0073aa;<br \/>            margin-top: 0;<br \/>            margin-bottom: 15px;<br \/>            font-size: 1.3em;<br \/>            display: flex;<br \/>            align-items: center;<br \/>            gap: 8px;<br \/>        }<\/p>\n<p>        .feature-card ul {<br \/>            margin: 0;<br \/>            padding-left: 20px;<br \/>        }<\/p>\n<p>        .feature-card li {<br \/>            margin-bottom: 8px;<br \/>            color: #555;<br \/>        }<\/p>\n<p>        \/* Tables *\/<br \/>        .params-table {<br \/>            width: 100%;<br \/>            border-collapse: collapse;<br \/>            margin: 20px 0;<br \/>            background: white;<br \/>            border-radius: 8px;<br \/>            overflow: hidden;<br \/>            box-shadow: 0 4px 15px rgba(0,0,0,0.1);<br \/>        }<\/p>\n<p>        .params-table th {<br \/>            background: linear-gradient(135deg, #0073aa, #005a87);<br \/>            color: white;<br \/>            padding: 15px 12px;<br \/>            text-align: left;<br \/>            font-weight: 600;<br \/>            font-size: 0.95em;<br \/>        }<\/p>\n<p>        .params-table td {<br \/>            padding: 12px;<br \/>            border-bottom: 1px solid #eee;<br \/>            vertical-align: top;<br \/>        }<\/p>\n<p>        .params-table tr:hover {<br \/>            background-color: #f8f9ff;<br \/>        }<\/p>\n<p>        .params-table tr:last-child td {<br \/>            border-bottom: none;<br \/>        }<\/p>\n<p>        \/* Parameter type badges *\/<br \/>        .param-type {<br \/>            display: inline-block;<br \/>            padding: 4px 8px;<br \/>            border-radius: 4px;<br \/>            font-size: 0.85em;<br \/>            font-weight: 500;<br \/>            margin-right: 5px;<br \/>        }<\/p>\n<p>        .param-string { background: #e3f2fd; color: #1565c0; }<br \/>        .param-integer { background: #f3e5f5; color: #7b1fa2; }<br \/>        .param-switch { background: #e8f5e8; color: #2e7d32; }<\/p>\n<p>        .param-required {<br \/>            background: #ffebee;<br \/>            color: #c62828;<br \/>            padding: 2px 6px;<br \/>            border-radius: 3px;<br \/>            font-size: 0.8em;<br \/>            font-weight: bold;<br \/>        }<\/p>\n<p>        .param-optional {<br \/>            background: #f1f8e9;<br \/>            color: #558b2f;<br \/>            padding: 2px 6px;<br \/>            border-radius: 3px;<br \/>            font-size: 0.8em;<br \/>            font-weight: bold;<br \/>        }<\/p>\n<p>        \/* Code blocks *\/<br \/>        .code-block {<br \/>            background: #2d3748;<br \/>            color: #e2e8f0;<br \/>            padding: 20px;<br \/>            border-radius: 8px;<br \/>            overflow-x: auto;<br \/>            margin: 20px 0;<br \/>            font-family: 'Consolas', 'Monaco', 'Courier New', monospace;<br \/>            font-size: 0.9em;<br \/>            line-height: 1.5;<br \/>            box-shadow: 0 4px 15px rgba(0,0,0,0.1);<br \/>        }<\/p>\n<p>        .code-block .comment {<br \/>            color: #68d391;<br \/>        }<\/p>\n<p>        .code-block .string {<br \/>            color: #fbb6ce;<br \/>        }<\/p>\n<p>        .code-block .keyword {<br \/>            color: #90cdf4;<br \/>        }<\/p>\n<p>        \/* Inline code *\/<br \/>        .inline-code {<br \/>            background: #f7fafc;<br \/>            color: #2d3748;<br \/>            padding: 2px 6px;<br \/>            border-radius: 4px;<br \/>            font-family: 'Consolas', 'Monaco', 'Courier New', monospace;<br \/>            font-size: 0.9em;<br \/>            border: 1px solid #e2e8f0;<br \/>        }<\/p>\n<p>        \/* Alert boxes *\/<br \/>        .alert {<br \/>            padding: 15px 20px;<br \/>            border-radius: 8px;<br \/>            margin: 20px 0;<br \/>            border-left: 4px solid;<br \/>        }<\/p>\n<p>        .alert-info {<br \/>            background: #e3f2fd;<br \/>            border-color: #2196f3;<br \/>            color: #0d47a1;<br \/>        }<\/p>\n<p>        .alert-warning {<br \/>            background: #fff3e0;<br \/>            border-color: #ff9800;<br \/>            color: #e65100;<br \/>        }<\/p>\n<p>        .alert-success {<br \/>            background: #e8f5e8;<br \/>            border-color: #4caf50;<br \/>            color: #1b5e20;<br \/>        }<\/p>\n<p>        \/* Quick start section *\/<br \/>        .quick-start {<br \/>            background: linear-gradient(135deg, #667eea, #764ba2);<br \/>            color: white;<br \/>            padding: 30px;<br \/>            border-radius: 12px;<br \/>            margin: 30px 0;<br \/>            box-shadow: 0 8px 32px rgba(0,0,0,0.1);<br \/>        }<\/p>\n<p>        .quick-start h3 {<br \/>            color: white;<br \/>            border: none;<br \/>            padding: 0;<br \/>            margin-top: 0;<br \/>        }<\/p>\n<p>        .quick-start .code-block {<br \/>            background: rgba(0,0,0,0.3);<br \/>            border: 1px solid rgba(255,255,255,0.2);<br \/>        }<\/p>\n<p>        \/* Usage examples *\/<br \/>        .usage-example {<br \/>            background: #f8f9fa;<br \/>            border: 1px solid #dee2e6;<br \/>            border-radius: 8px;<br \/>            padding: 20px;<br \/>            margin: 20px 0;<br \/>        }<\/p>\n<p>        .usage-example h5 {<br \/>            color: #0073aa;<br \/>            margin-top: 0;<br \/>            margin-bottom: 15px;<br \/>            font-size: 1.1em;<br \/>        }<\/p>\n<p>        \/* Responsive design *\/<br \/>        @media (max-width: 768px) {<br \/>            .ej-docs {<br \/>                padding: 10px;<br \/>            }<\/p>\n<p>            .ej-docs h1 {<br \/>                font-size: 2em;<br \/>                padding: 20px;<br \/>            }<\/p>\n<p>            .feature-badges {<br \/>                grid-template-columns: 1fr;<br \/>            }<\/p>\n<p>            .params-table {<br \/>                font-size: 0.9em;<br \/>            }<\/p>\n<p>            .params-table th,<br \/>            .params-table td {<br \/>                padding: 8px;<br \/>            }<br \/>        }<\/p>\n<p>        \/* WordPress compatibility *\/<br \/>        .ej-docs * {<br \/>            box-sizing: border-box;<br \/>        }<\/p>\n<p>        .ej-docs ul, .ej-docs ol {<br \/>            padding-left: 20px;<br \/>        }<\/p>\n<p>        .ej-docs li {<br \/>            margin-bottom: 5px;<br \/>        }<\/p>\n<p>        \/* Print styles *\/<br \/>        @media print {<br \/>            .ej-docs {<br \/>                max-width: none;<br \/>                padding: 0;<br \/>            }<\/p>\n<p>            .feature-card,<br \/>            .code-block,<br \/>            .alert {<br \/>                break-inside: avoid;<br \/>            }<br \/>        }<br \/>    <\/style>\n<p>\u00a0<\/p>\n<div class=\"ej-docs\">\n<h1>Exchange Online Journaling & Reporting Suite<\/h1>\n<p style=\"text-align: center; font-size: 1.2em; color: #666; margin-bottom: 40px;\">A comprehensive PowerShell solution for configuring Exchange Online journaling and generating automated monthly HTML reports with detailed message analytics and user insights.<\/p>\n<h2>Features Overview<\/h2>\n<div class=\"feature-badges\">\n<div class=\"feature-card\">\n<h4>Journaling Configuration<\/h4>\n<ul>\n<li>Global Journaling Rules \u2013 Capture all messages<\/li>\n<li>Automatic Prerequisites \u2013 Handles undeliverable reports<\/li>\n<li>Mailbox Validation \u2013 Ensures required mailboxes exist<\/li>\n<li>Interactive Setup \u2013 Prompts for missing information<\/li>\n<li>Rule Management \u2013 Creates and updates seamlessly<\/li>\n<\/ul>\n<\/div>\n<div class=\"feature-card\">\n<h4>Advanced Monthly Reporting<\/h4>\n<ul>\n<li>Full Monthly Coverage \u2013 Complete calendar month reports<\/li>\n<li>Enhanced User Analysis \u2013 Detailed sender\/recipient info<\/li>\n<li>Professional HTML Reports \u2013 Modern, responsive design<\/li>\n<li>Message Statistics \u2013 Comprehensive breakdowns<\/li>\n<li>Activity Metrics \u2013 Daily averages and patterns<\/li>\n<\/ul>\n<\/div>\n<div class=\"feature-card\">\n<h4>Automation Features<\/h4>\n<ul>\n<li>Scheduled Tasks \u2013 Automated monthly generation<\/li>\n<li>Multiple Creation Methods \u2013 XML, PowerShell, schtasks<\/li>\n<li>Error Handling \u2013 Robust error management<\/li>\n<li>Task Verification \u2013 Automatic testing<\/li>\n<li>Fallback Options \u2013 Multiple creation approaches<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<div class=\"quick-start\">\n<h3>Quick Start<\/h3>\n<p>Get up and running in minutes with these essential commands:<\/p>\n<div class=\"code-block\"><span class=\"comment\"># Install required modules<\/span><br \/>\n<span class=\"keyword\">Install-Module<\/span> -Name ExchangeOnlineManagement -Force -AllowClobber<span class=\"comment\"># Configure journaling and generate current month report<\/span><br \/>\n<span class=\"keyword\">.\\Configure-ExchangeJournaling.ps1<\/span> <span class=\"string\">-JournalEmailAddress \u201cjournal@yourdomain.com\u201d<\/span> <span class=\"string\">-UndeliverableReportsAddress \u201cundeliverable@yourdomain.com\u201d<\/span><span class=\"comment\"># Set up automated monthly reports<\/span><br \/>\n<span class=\"keyword\">.\\Schedule-JournalingReports.ps1<\/span> <span class=\"string\">-JournalEmailAddress \u201cjournal@yourdomain.com\u201d<\/span><\/div>\n<\/div>\n<h2>Detailed Script Documentation<\/h2>\n<h3>Main Script: Configure-ExchangeJournaling.ps1<\/h3>\n<p>The primary script that handles both journaling configuration and report generation. This script provides comprehensive functionality for setting up Exchange Online journaling and creating detailed monthly reports.<\/p>\n<h4>Parameters Reference<\/h4>\n<table class=\"params-table\">\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Required<\/th>\n<th>Default<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>JournalEmailAddress<\/strong><\/td>\n<td><span class=\"param-type param-string\">String<\/span><\/td>\n<td><span class=\"param-required\">Required<\/span><\/td>\n<td>\u2013<\/td>\n<td>Email address where journal reports will be sent. This mailbox must exist before running the script.<\/td>\n<\/tr>\n<tr>\n<td><strong>UndeliverableReportsAddress<\/strong><\/td>\n<td><span class=\"param-type param-string\">String<\/span><\/td>\n<td><span class=\"param-optional\">Optional<\/span><\/td>\n<td>\u2013<\/td>\n<td>Email address where undeliverable journal reports will be sent. Required for journaling configuration but can be provided interactively.<\/td>\n<\/tr>\n<tr>\n<td><strong>ReportPath<\/strong><\/td>\n<td><span class=\"param-type param-string\">String<\/span><\/td>\n<td><span class=\"param-optional\">Optional<\/span><\/td>\n<td><span class=\"inline-code\">C:\\ExchangeReports<\/span><\/td>\n<td>Directory path where HTML reports will be saved. Directory will be created if it doesn\u2019t exist.<\/td>\n<\/tr>\n<tr>\n<td><strong>MonthsBack<\/strong><\/td>\n<td><span class=\"param-type param-integer\">Integer<\/span><\/td>\n<td><span class=\"param-optional\">Optional<\/span><\/td>\n<td><span class=\"inline-code\">1<\/span><\/td>\n<td>Number of months back to generate reports for. Each month generates a separate report file.<\/td>\n<\/tr>\n<tr>\n<td><strong>UseHistoricalSearch<\/strong><\/td>\n<td><span class=\"param-type param-switch\">Switch<\/span><\/td>\n<td><span class=\"param-optional\">Optional<\/span><\/td>\n<td><span class=\"inline-code\">False<\/span><\/td>\n<td>Use historical search for data older than 10 days. Slower but more comprehensive for complete monthly reports.<\/td>\n<\/tr>\n<tr>\n<td><strong>SkipJournalingConfig<\/strong><\/td>\n<td><span class=\"param-type param-switch\">Switch<\/span><\/td>\n<td><span class=\"param-optional\">Optional<\/span><\/td>\n<td><span class=\"inline-code\">False<\/span><\/td>\n<td>Skip journaling configuration and only generate reports. Useful for report-only executions.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Usage Examples<\/h4>\n<div class=\"usage-example\">\n<h5>Complete Setup with Journaling and Reporting<\/h5>\n<div class=\"code-block\"><span class=\"keyword\">.\\Configure-ExchangeJournaling.ps1<\/span> `<br \/>\n<span class=\"string\">-JournalEmailAddress \u201cjournal@contoso.com\u201d<\/span> `<br \/>\n<span class=\"string\">-UndeliverableReportsAddress \u201cundeliverable@contoso.com\u201d<\/span> `<br \/>\n<span class=\"string\">-ReportPath \u201cD:\\Reports\u201d<\/span> `<br \/>\n<span class=\"string\">-MonthsBack 3<\/span> `<br \/>\n<span class=\"string\">-UseHistoricalSearch<\/span><\/div>\n<p>This example configures journaling with all prerequisites and generates reports for the last 3 months using historical search for complete data.<\/p>\n<\/div>\n<div class=\"usage-example\">\n<h5>Reports Only (Skip Journaling Configuration)<\/h5>\n<div class=\"code-block\"><span class=\"keyword\">.\\Configure-ExchangeJournaling.ps1<\/span> `<br \/>\n<span class=\"string\">-JournalEmailAddress \u201cjournal@contoso.com\u201d<\/span> `<br \/>\n<span class=\"string\">-SkipJournalingConfig<\/span><\/div>\n<p>Perfect for scheduled tasks or when journaling is already configured. Only generates the current month report.<\/p>\n<\/div>\n<div class=\"usage-example\">\n<h5>Interactive Setup<\/h5>\n<div class=\"code-block\"><span class=\"keyword\">.\\Configure-ExchangeJournaling.ps1<\/span> <span class=\"string\">-JournalEmailAddress \u201cjournal@contoso.com\u201d<\/span><\/div>\n<p>The script will interactively prompt for any missing required information, such as the undeliverable reports address.<\/p>\n<\/div>\n<div class=\"alert alert-info\"><strong> Pro Tip:<\/strong> For complete monthly reports that include data older than 10 days, always use the <span class=\"inline-code\">-UseHistoricalSearch<\/span> parameter. This ensures you get comprehensive data for the entire month.<\/div>\n<h3>Automation Script: Schedule-JournalingReports.ps1<\/h3>\n<p>This script creates Windows scheduled tasks to automatically run monthly reports. It includes multiple fallback methods to ensure reliable task creation across different Windows environments.<\/p>\n<h4>Parameters Reference<\/h4>\n<table class=\"params-table\">\n<thead>\n<tr>\n<th>Parameter<\/th>\n<th>Type<\/th>\n<th>Required<\/th>\n<th>Default<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>JournalEmailAddress<\/strong><\/td>\n<td><span class=\"param-type param-string\">String<\/span><\/td>\n<td><span class=\"param-required\">Required<\/span><\/td>\n<td>\u2013<\/td>\n<td>Email address for journal destination. Must match the address used in the main script.<\/td>\n<\/tr>\n<tr>\n<td><strong>ReportPath<\/strong><\/td>\n<td><span class=\"param-type param-string\">String<\/span><\/td>\n<td><span class=\"param-optional\">Optional<\/span><\/td>\n<td><span class=\"inline-code\">C:\\ExchangeReports<\/span><\/td>\n<td>Directory where HTML reports will be saved. Should match the path used in the main script.<\/td>\n<\/tr>\n<tr>\n<td><strong>ScriptPath<\/strong><\/td>\n<td><span class=\"param-type param-string\">String<\/span><\/td>\n<td><span class=\"param-optional\">Optional<\/span><\/td>\n<td><span class=\"inline-code\">C:\\Scripts\\Configure-ExchangeJournaling.ps1<\/span><\/td>\n<td>Full path to the main Configure-ExchangeJournaling.ps1 script file.<\/td>\n<\/tr>\n<tr>\n<td><strong>TaskName<\/strong><\/td>\n<td><span class=\"param-type param-string\">String<\/span><\/td>\n<td><span class=\"param-optional\">Optional<\/span><\/td>\n<td><span class=\"inline-code\">Exchange Online Monthly Report<\/span><\/td>\n<td>Name for the scheduled task. Must be unique in the Windows Task Scheduler.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Usage Examples<\/h4>\n<div class=\"usage-example\">\n<h5>Basic Scheduled Task Creation<\/h5>\n<div class=\"code-block\"><span class=\"keyword\">.\\Schedule-JournalingReports.ps1<\/span> <span class=\"string\">-JournalEmailAddress \u201cjournal@contoso.com\u201d<\/span><\/div>\n<p>Creates a basic monthly scheduled task using default paths and settings. The task will run on the 1st of each month at 2:00 AM.<\/p>\n<\/div>\n<div class=\"usage-example\">\n<h5>Custom Paths and Task Name<\/h5>\n<div class=\"code-block\"><span class=\"keyword\">.\\Schedule-JournalingReports.ps1<\/span> `<br \/>\n<span class=\"string\">-JournalEmailAddress \u201cjournal@contoso.com\u201d<\/span> `<br \/>\n<span class=\"string\">-ReportPath \u201c\\\\FileServer\\Reports\u201d<\/span> `<br \/>\n<span class=\"string\">-ScriptPath \u201c\\\\FileServer\\Scripts\\Configure-ExchangeJournaling.ps1\u201d<\/span> `<br \/>\n<span class=\"string\">-TaskName \u201cMonthly Exchange Analytics\u201d<\/span><\/div>\n<p>Perfect for enterprise environments with centralized file storage. Uses UNC paths for network accessibility.<\/p>\n<\/div>\n<div class=\"alert alert-warning\"><strong>\u26a0\ufe0f Important:<\/strong> The scheduling script should be run as Administrator to ensure proper task creation with system-level permissions. The script includes multiple fallback methods if the primary creation method fails.<\/div>\n<h2>Advanced Configuration<\/h2>\n<h3>Prerequisites Setup<\/h3>\n<p>Before running the scripts, ensure you have the following prerequisites configured:<\/p>\n<h4>1. Required Mailboxes<\/h4>\n<div class=\"code-block\"><span class=\"comment\"># Create journal mailbox<\/span><br \/>\n<span class=\"keyword\">New-Mailbox<\/span> -Name <span class=\"string\">\u201cJournal Mailbox\u201d<\/span> -Alias <span class=\"string\">\u201cjournal\u201d<\/span> -UserPrincipalName <span class=\"string\">\u201cjournal@yourdomain.com\u201d<\/span><span class=\"comment\"># Create undeliverable reports mailbox<\/span><br \/>\n<span class=\"keyword\">New-Mailbox<\/span> -Name <span class=\"string\">\u201cUndeliverable Reports\u201d<\/span> -Alias <span class=\"string\">\u201cundeliverable\u201d<\/span> -UserPrincipalName <span class=\"string\">\u201cundeliverable@yourdomain.com\u201d<\/span><\/div>\n<h4>2. Required Permissions<\/h4>\n<ul>\n<li><strong>Exchange Administrator<\/strong> role for journaling configuration<\/li>\n<li><strong>Compliance Administrator<\/strong> role for message trace access<\/li>\n<li><strong>Local Administrator<\/strong> rights for scheduled task creation<\/li>\n<\/ul>\n<h3>Historical Data Access<\/h3>\n<p>For complete monthly reports that include data beyond the standard 10-day limit:<\/p>\n<div class=\"code-block\"><span class=\"comment\"># Enable historical search for complete monthly data<\/span><br \/>\n<span class=\"keyword\">.\\Configure-ExchangeJournaling.ps1<\/span> `<br \/>\n<span class=\"string\">-JournalEmailAddress \u201cjournal@yourdomain.com\u201d<\/span> `<br \/>\n<span class=\"string\">-UseHistoricalSearch<\/span> `<br \/>\n<span class=\"string\">-MonthsBack 6<\/span><\/div>\n<div class=\"alert alert-info\"><strong> Note:<\/strong> Historical searches require additional permissions and can take several minutes to complete. They provide access to comprehensive data for complete monthly analysis.<\/div>\n<h3>Custom Report Scheduling<\/h3>\n<p>For advanced scheduling scenarios, you can manually create custom schedules using Windows Task Scheduler:<\/p>\n<ol>\n<li>Open <strong>Task Scheduler<\/strong> (<span class=\"inline-code\">taskschd.msc<\/span>)<\/li>\n<li>Create <strong>Basic Task<\/strong><\/li>\n<li>Set <strong>Trigger:<\/strong> Monthly, 1st day, 2:00 AM<\/li>\n<li>Set <strong>Action:<\/strong> Start PowerShell.exe<\/li>\n<li>Configure <strong>Arguments:<\/strong><\/li>\n<\/ol>\n<div class=\"code-block\">-ExecutionPolicy Bypass -File <span class=\"string\">\u201cC:\\Scripts\\Configure-ExchangeJournaling.ps1\u201d<\/span> -JournalEmailAddress <span class=\"string\">\u201cjournal@yourdomain.com\u201d<\/span> -SkipJournalingConfig<\/div>\n<h2>Report Features<\/h2>\n<h3>Enhanced User Analysis<\/h3>\n<p>The generated reports include comprehensive analysis of your organization\u2019s email communication patterns:<\/p>\n<h4>Top 10 Senders Analysis<\/h4>\n<ul>\n<li><strong>User Information:<\/strong> Display name, email, title, department, office location<\/li>\n<li><strong>Message Statistics:<\/strong> Total message count with inbound\/outbound breakdown<\/li>\n<li><strong>Activity Metrics:<\/strong> Daily averages and unique recipient counts<\/li>\n<li><strong>External Indicators:<\/strong> Visual badges distinguishing external vs internal users<\/li>\n<\/ul>\n<h4>Top 10 Recipients Analysis<\/h4>\n<ul>\n<li><strong>User Information:<\/strong> Complete organizational details and contact information<\/li>\n<li><strong>Communication Patterns:<\/strong> Detailed message distribution analysis<\/li>\n<li><strong>Sender Diversity:<\/strong> Unique sender counts and communication breadth<\/li>\n<li><strong>Activity Trends:<\/strong> Daily communication averages and patterns<\/li>\n<\/ul>\n<h3>Visual Dashboard Features<\/h3>\n<div class=\"feature-badges\">\n<div class=\"feature-card\">\n<h4>Six Key Metrics<\/h4>\n<ul>\n<li>Total Messages<\/li>\n<li>Inbound\/Outbound Counts<\/li>\n<li>Daily Averages<\/li>\n<li>Unique Users<\/li>\n<\/ul>\n<\/div>\n<div class=\"feature-card\">\n<h4>Interactive Charts<\/h4>\n<ul>\n<li>Daily Volume Bar Charts<\/li>\n<li>Message Status Distribution<\/li>\n<li>Activity Pattern Visualization<\/li>\n<li>Responsive Design<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<h3>Monthly Coverage<\/h3>\n<ul>\n<li><strong>Complete Calendar Months:<\/strong> Always generates full month reports regardless of execution date<\/li>\n<li><strong>Smart Date Handling:<\/strong> Automatically calculates proper date ranges for accurate reporting<\/li>\n<li><strong>Current Month Support:<\/strong> Handles partial current month data intelligently<\/li>\n<li><strong>Historical Integration:<\/strong> Seamless access to older data when historical search is enabled<\/li>\n<\/ul>\n<div class=\"alert alert-success\"><strong>\u2705 Best Practice:<\/strong> Schedule reports to run on the 2nd or 3rd day of each month to ensure complete data availability for the previous month while maintaining timely reporting.<\/div>\n<h2>Troubleshooting Common Issues<\/h2>\n<h3>Journaling Configuration Failures<\/h3>\n<div class=\"alert alert-warning\"><strong>Error:<\/strong> \u201cBefore you create a journal rule, you must specify an email account to receive journal reports\u2026\u201d<\/div>\n<p><strong>Solution:<\/strong><\/p>\n<ul>\n<li>Ensure the undeliverable reports mailbox exists in your organization<\/li>\n<li>Provide the <span class=\"inline-code\">-UndeliverableReportsAddress<\/span> parameter<\/li>\n<li>Run the script interactively to be prompted for the missing address<\/li>\n<\/ul>\n<h3>Date Range Limitations<\/h3>\n<div class=\"alert alert-warning\"><strong>Error:<\/strong> \u201cInvalid StartDate value. The StartDate can\u2019t be older than 10 days from today.\u201d<\/div>\n<p><strong>Solution:<\/strong><\/p>\n<ul>\n<li>Use <span class=\"inline-code\">-UseHistoricalSearch<\/span> for data older than 10 days<\/li>\n<li>Accept the automatic date range adjustment for recent data<\/li>\n<li>Consider using Exchange Online admin center for comprehensive historical reports<\/li>\n<\/ul>\n<h3>Scheduled Task Creation Issues<\/h3>\n<div class=\"alert alert-warning\"><strong>Error:<\/strong> \u201cA parameter cannot be found that matches parameter name \u2018Monthly'\u201d<\/div>\n<p><strong>Solution:<\/strong><\/p>\n<ul>\n<li>Run PowerShell as Administrator<\/li>\n<li>The script includes multiple fallback methods automatically<\/li>\n<li>Use manual task creation instructions provided in error output<\/li>\n<\/ul>\n<h3>Permission Issues<\/h3>\n<p><strong>Solution:<\/strong><\/p>\n<ul>\n<li>Verify <strong>Exchange Administrator<\/strong> role assignment<\/li>\n<li>Ensure <strong>Compliance Administrator<\/strong> permissions<\/li>\n<li>Check <strong>local administrator<\/strong> rights for scheduled tasks<\/li>\n<li>Confirm mailbox access permissions for journal and undeliverable addresses<\/li>\n<\/ul>\n<div class=\"alert alert-info\"><strong> Debug Mode:<\/strong> Enable verbose output for detailed troubleshooting by adding <span class=\"inline-code\">-Verbose<\/span> to any script execution.<\/div>\n<h2>Best Practices<\/h2>\n<h3>Security Recommendations<\/h3>\n<ul>\n<li>Use dedicated service accounts for automation tasks<\/li>\n<li>Store credentials securely using Windows Credential Manager<\/li>\n<li>Implement least-privilege access principles<\/li>\n<li>Enable audit logging for compliance requirements<\/li>\n<li>Regularly review and rotate service account credentials<\/li>\n<\/ul>\n<h3>Performance Optimization<\/h3>\n<ul>\n<li>Schedule reports during off-peak hours (typically 2:00-4:00 AM)<\/li>\n<li>Use historical search sparingly as it\u2019s resource intensive<\/li>\n<li>Implement report archiving to prevent disk space issues<\/li>\n<li>Monitor Exchange Online throttling limits during execution<\/li>\n<li>Consider staggered execution for multiple tenant environments<\/li>\n<\/ul>\n<h3>Maintenance Guidelines<\/h3>\n<ul>\n<li>Review and update mailbox permissions quarterly<\/li>\n<li>Archive old reports to prevent storage issues<\/li>\n<li>Test scheduled tasks monthly to ensure proper operation<\/li>\n<li>Update PowerShell modules regularly for security and features<\/li>\n<li>Document any customizations for future reference<\/li>\n<\/ul>\n<div style=\"text-align: center; margin-top: 50px; padding: 30px; background: linear-gradient(135deg, #f8f9fa, #e9ecef); border-radius: 12px;\">\n<h3 style=\"color: #0073aa; margin-bottom: 15px;\">Ready to Get Started?<\/h3>\n<p style=\"font-size: 1.1em; color: #555; margin-bottom: 20px;\">Download the scripts and start automating your Exchange Online journaling and reporting today!<\/p>\n<div style=\"display: flex; gap: 15px; justify-content: center; flex-wrap: wrap;\"><a style=\"background: linear-gradient(135deg, #0073aa, #005a87); color: white; padding: 12px 24px; text-decoration: none; border-radius: 6px; font-weight: 500;\" href=\"https:\/\/github.com\/MSB365\/Exchange-Online-Journaling\/blob\/main\/Configure-ExchangeJournaling.ps1\" target=\"_blank\" rel=\"noopener\">Download Scripts<\/a><br \/>\n<a style=\"background: linear-gradient(135deg, #667eea, #764ba2); color: white; padding: 12px 24px; text-decoration: none; border-radius: 6px; font-weight: 500;\" href=\"https:\/\/github.com\/MSB365\/Exchange-Online-Journaling\/tree\/main\" target=\"_blank\" rel=\"noopener\">View on GitHub<\/a><\/div>\n<\/div>\n<div style=\"text-align: center; margin-top: 30px; color: #666; font-size: 0.9em;\">\n<p>\u00a0<\/p>\n<\/div>\n<\/div>\n<h3>Result example<\/h3>\n<p>\u00a0<\/p>\n<table>\n<tbody>\n<tr>\n<td width=\"301\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone size-large wp-image-5945\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-1-1024x658.png\" alt=\"\" width=\"1024\" height=\"658\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-1-1024x658.png 1024w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-1-300x193.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-1-768x493.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-1.png 1071w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/td>\n<td width=\"301\"><img decoding=\"async\" class=\"alignnone size-large wp-image-5946\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-2-1024x508.png\" alt=\"\" width=\"1024\" height=\"508\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-2-1024x508.png 1024w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-2-300x149.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-2-768x381.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-2.png 1086w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/td>\n<\/tr>\n<tr>\n<td width=\"301\"><img decoding=\"async\" class=\"alignnone size-large wp-image-5947\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-3-1024x616.png\" alt=\"\" width=\"1024\" height=\"616\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-3-1024x616.png 1024w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-3-300x181.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-3-768x462.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-3.png 1080w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/td>\n<td width=\"301\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-5948\" src=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-4-1024x754.png\" alt=\"\" width=\"1024\" height=\"754\" srcset=\"https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-4-1024x754.png 1024w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-4-300x221.png 300w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-4-768x566.png 768w, https:\/\/msb365.abstergo.ch\/wp-content\/uploads\/2025\/06\/EXOJ-4.png 1119w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>Journaling on Exchange (on-premise) is a feature that is often needed, especially for companies that have an obligation to the authorities to comply with the retention obligation. With Exchange online this is a little more difficult. 3rd party tools should be used for this, as native journaling is not intended. I have developed a solution [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5943,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[2,3],"tags":[],"class_list":["post-5932","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-exchange","category-powershell"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/5932","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5932"}],"version-history":[{"count":9,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/5932\/revisions"}],"predecessor-version":[{"id":5949,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/posts\/5932\/revisions\/5949"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=\/wp\/v2\/media\/5943"}],"wp:attachment":[{"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.msb365.blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}