#
E365-Quarantine-ExportRecord.ps1
Purpose Dependencies Function Usage Inputs Variables Command Line Flags Outputs Notes
#
Purpose
Exports Microsoft 365 Exchange quarantine message records and Tenant Allow/Block List (TABL) data to CSV files for analysis. Supports cross-platform operation (Windows, macOS, Linux), robust error handling, and modern authentication (FIDO2/WebAuthn).
This is to assist email administrators in using an accompying XLS file to quickly reconcile domains in quarantine, which are not already in the Tenant Allow/Block List (TABL), and drive faster action for adding domains for blocking via TABL.
Previously downloaded CSV files are archived at the start of the script, to ensure these records can be kept if needed.
#
Dependencies
- PowerShell 7.0 or later (Install Guide)
- Exchange Online Management module (Microsoft Docs)
#
Function
- Detects operating system and sets cross-platform file paths for output and archiving.
- Ensures required directories exist and archives previous CSV files with date-stamped names.
- Validates PowerShell 7 environment and required modules, installing if needed.
- Connects to Exchange Online using modern authentication.
- Downloads up to 10,000 quarantine message records (paginated) and exports to
quarantine.csv
. - Downloads Tenant Allow/Block List (Sender type) and exports to
tabl.csv
. - Provides robust error handling, progress indication, and clear user feedback.
#
Usage
./E365-Quarantine-ExportRecord.ps1
The script is fully interactive and does not require command-line parameters for standard use. Output files are saved to platform-specific locations.
#
Inputs
None for standard use. (All paths and options are handled interactively and by platform detection.)
#
Variables
$directoryPath
: Output directory for CSV files$targetFolder
: Archive directory for old CSVs$filePathQuarantine
,$filePathTABL
: Output file paths$moduleNames
: Required modules
#
Command Line Flags
None for standard use.
#
Outputs
quarantine.csv
: Quarantine message recordstabl.csv
: Tenant Allow/Block List data- Archived previous CSVs with date-stamped names
- Console and error output for user feedback
#
Notes
- Requires PowerShell 7 and Exchange Online Management module
- Script is cross-platform and handles all file paths automatically
- See script header for links to official documentation and further details