This scripts helps to suspend all messages in an Exchange transport queue and to export all suspended messages to a given target folder.
The script uses the AssembleMessage cmdlet to properly export queued messages as .eml files.
Optionally, all exported messages can be removed from the transport queue.
This script requires the GlobalFunctions module for logging.
# EXAMPLE 1 # Export messages from queue MCMEP01\45534 to D:\ExportedMessages and do not delete messages after export .\Export-MessageQueue -Queue MCMEP01\45534 -Path D:\ExportedMessages # EXAMPLE 2 # Export messages from queue MCMEP01\45534 to D:\ExportedMessages and delete messages after export .\Export-MessageQueue -Queue MCMEP01\45534 -Path D:\ExportedMessages -DeleteAfterExport
As always: Test and familiarize yourself with the script in a test or development environment.
The script sends a given number of test emails to a configured SMTP host for test purposes (primarily Exchange queues, transport agents, or anti-virus engines).
Do not forget to adjust script variables to suit your local Exchange infrastructure.
# EXAMPLE 1 # Send 10 normal emails .\Send-TestMail.ps1 -Normal -MessageCount 10 # EXAMPLE 2 # Send an Eicar test email .\Send-TestMail.ps1 -Eicar
Add remote IP address ranges to an Exchange Server 2013/2016 receive connector.
Create a new text file containing the new remote IP address ranges
Example:
192.168.1.1 192.168.2.10-192.168.2.20 192.168.3.0/24
The script creates a new subfolder named ReceiveConnectorIpAddresses and saves the currently configured remote IP address ranges first.
While adding the new remote IP address ranges, the script checks, if the new ranges already exist.
# Add IP addresses from ip.txt to MYCONNECTOR .\Add-ReceiveConnectorIpAddress.ps1 -ConnectorName MYCONNECTOR -FileName D:\Scripts\ip.txt .\Add-ReceiveConnectorIpAddress.ps1 -ConnectorName REMOTECONNECTOR -FileName .\ip-new.txt -ViewEntireForest $true