-
Notifications
You must be signed in to change notification settings - Fork 247
ASD OWA Mailbox Configuration Check
directorcia edited this page Nov 12, 2025
·
1 revision
asd-owamail-get.ps1 audits Exchange Online OWA (Outlook on the Web) mailbox policy settings against an ASD Blueprint baseline. It loads a JSON definition (default fetched from GitHub) where each top‑level property represents an OWA mailbox policy name and its child properties are the required setting values. The script compares tenant values, reports PASS/FAIL per setting, exports optional CSV, and always produces a styled HTML compliance report.
- Automatic download of latest baseline JSON (unless a custom path/URL supplied)
- Schema validation of baseline
- Comparison of every setting in each baseline policy
- Identification of missing policies (all their settings marked FAIL)
- HTML report with colored summary metrics (Total / Passed / Failed / Compliance)
- Optional CSV export for downstream processing
- Detailed logging mode for troubleshooting
| Requirement | Notes |
|---|---|
| PowerShell 5.1+ / 7.x | Recommended: latest version |
Module: ExchangeOnlineManagement
|
Install if missing: Install-Module ExchangeOnlineManagement -Scope CurrentUser
|
| Permissions | Global Reader, Exchange Administrator, View-Only Organization Management, or equivalent read rights |
| Internet access | Needed when using default GitHub baseline URL |
Example (truncated):
{
"OwaMailboxPolicy-Default": {
"InstantMessagingEnabled": true,
"TextMessagingEnabled": true,
"ActiveSyncIntegrationEnabled": false,
"ContactsEnabled": true,
"OfflineAccessEnabled": "Always"
}
}Rules:
- Root object: each property name = OWA mailbox policy name (
Get-OwaMailboxPolicy | Select Name). - Property value: object with setting name/value pairs (bool, string, number).
- A missing tenant policy causes all its required settings to FAIL.
| Parameter | Type | Description | Default |
|---|---|---|---|
-BaselinePath |
String | Path or URL to baseline JSON. | GitHub URL to owamail.json
|
-ExportToCSV |
Switch | Export results to CSV. | Not exported |
-CSVPath |
String | Custom CSV file path. | Auto: parent directory with timestamp |
-DetailedLogging |
Switch | Enable verbose logging to file. | Disabled |
-LogPath |
String | Custom log file path. | Auto if logging enabled |
| Artifact | Location (default) | Notes |
|---|---|---|
| HTML report | Parent directory (asd-owamail-get-<timestamp>.html) |
Opens automatically; contains summary + table |
| CSV (optional) | Parent directory or -CSVPath
|
Columns: Policy, Setting, CurrentValue, RequiredValue, Status |
| Log (optional) | Parent directory or -LogPath
|
Detailed steps, errors, comparisons |
- Parse parameters & establish output paths.
- Load baseline JSON (GitHub URL or local file).
- Validate baseline schema.
- Ensure
ExchangeOnlineManagementmodule is available & import. - Connect to Exchange Online (reuse existing session if present).
- Verify permissions by calling
Get-OrganizationConfig. - Retrieve OWA mailbox policies via
Get-OwaMailboxPolicy. - For each baseline policy & setting: read current value, compare to required value.
- Accumulate results, compute totals & compliance percentage.
- Print console summary; optionally export CSV.
- Generate HTML report (always) and attempt to open it.
- Write log entries when logging enabled.
- Boolean & string comparisons are case-insensitive for strings.
- If required value is
null, any current value passes. - If setting missing on tenant policy, treated as
Not setand fails (unless required is null). - Policy absent in tenant: all its baseline settings fail.
Basic run:
./asd-owamail-get.ps1Run with CSV export:
./asd-owamail-get.ps1 -ExportToCSVCustom baseline & CSV path:
./asd-owamail-get.ps1 -BaselinePath "C:\Config\owamail-prod.json" -ExportToCSV -CSVPath "C:\Reports\owapolicy.csv"Enable detailed logging:
./asd-owamail-get.ps1 -DetailedLoggingCustom log file:
./asd-owamail-get.ps1 -DetailedLogging -LogPath "C:\Logs\owapolicy.log"Sections:
- Header: Title + generation timestamp
- Summary: Total checks, Passed, Failed, Compliance (colored values)
- Table: Per-setting PASS/FAIL with current vs required values
- Overall status banner: COMPLIANT or NON-COMPLIANT
| Issue | Cause | Resolution |
|---|---|---|
| Module not found |
ExchangeOnlineManagement missing |
Install module; reopen PowerShell |
| Auth prompt appears repeatedly | Stale session / cached token issue | Close all PowerShell windows, re-run script |
| Policies missing | Baseline includes policy not deployed | Create policy or adjust baseline |
| All settings FAIL | Wrong policy names or insufficient permissions | Verify names via Get-OwaMailboxPolicy; ensure required role |
| HTML not opening |
Start-Process blocked or path issue |
Manually open the HTML file from explorer |
| Non-colored summary | Cached old HTML | Hard refresh or delete old report; re-run script |
- Add remediation recommendation column (e.g. required value explanation).
- Parameter to filter specific policies (
-Policies). - JSON metadata section (e.g. version, author, baseline date) displayed in report.
- Switch for plain text output (for CI pipelines).
- Read-only operations: Script does not modify tenant configuration.
- Ensure baseline JSON is sourced from trusted repository (default GitHub URL).
- Review log file contents before sharing (may include internal policy names).
| Code | Meaning |
|---|---|
| 0 | Success (report generated) |
| 1 | Fatal error (baseline load, connection, permission, or unexpected exception) |
- Periodically update baseline JSON to reflect new ASD recommendations.
- Version tag inside script (
$scriptVersion) should be incremented on functional changes. - Validate after Exchange Online schema updates (run and check for new/missing properties).
-
asd-mailflow-get.ps1– Mail flow settings compliance (similar report style)
Created by CIAOPS. Refer to project repository for licensing or contribution guidelines.
Generated documentation for operational clarity and onboarding.