Out-of-Office (OOF) messages have to follow the compliance rules as regular email communication. This is not necessarily a known fact to end users.
If a company does have a strict compliance policy regarding external OOF messages you can use the following solution to establish a strict and simple to use OOF configuration.
Only specific employees are supposed to send OOF messages to external recipients. All other employees are supposed to send internal OOF messages only.
The solution consists of two PowerShell scripts.
The first script is used to remove any exisiting OOF rules created by a user using the Outlook OOF Rule Wizard. This is required to avoid any strange behaviours in regards to OOF messages being sent even if OOF is deactivated. The most common reasons for such a behaviour are migrated OOF rules created by previous Exchange Server versions.
You can read more about scripts here:
You can use the follow command line example, if you want to automate the execution of script 2 using a scheduled task.
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -version 3.0 -command ". 'D:\Program Files\Microsoft\Exchange Server\V15\bin\RemoteExchange.ps1'; Connect-ExchangeServer -auto; "D:\Scripts\Set-ExternalOOF\Set-ExternalOOF.ps1 -RemoveRights"
This script searches for OOF rules created by users using the Outlook rule-tab in the OOF assistant and deletes exisiting OOF rules.
In preparation to configure compliant Out-Of-Office (OFF) settings for users, any existing OOF rule needs to be deleted. The script will use either an exisiting Exchange Server EWS library or the Managed EWS library installed using the default file path.
This is the first of two scripts for the complete solution. Find the second script here.
The script access the mailbox rules using Exchange Web Services. Therefore the account executing the script either needs to have ApplicationImpersonation rights or full access to the user mailbox.
# EXAMPLE 1
# Find any existing OOF rule and write results to log file
# EXAMPLE 2
# Find and delete any existing OOF rules in all user mailboxes and write delete actions to log file
# EXAMPLE 3
# Find and delete any existing OOF rules for user SomeUser@varunagroup.de and write delete actions to log file
Remove-OOFRule -Mailbox SomeUser@varunagroup.de -Delete
Rhoderick Milne (https://blogs.technet.microsoft.com/rmilne)
This script sets the mailbox ExternalOofOptions to 'External' for members of a given security group.
ExternalOofOptions for users that are NOT a member of the security group will be set to 'InternalOnly'. If required the script will set the ExternalAudience to None and will delete an existing OOF message.
Controlling the ExternalOofOptions and ExternalAudience settings has been implemented to follow dedicated company compliance rules.
This is the second of two scripts for the complete solution. Find the first script here.
# Run script with default settings
This script fetches emails from a given monitoring mailbox by searching email messages for a given subject string. In this case email messages sent by the ENow Management Suite (http://enowsoftware.com/). Status messages are parsed to extract Disk Performance alert data for further processing in Power BI.
The mailbox is queried using Exchange Web Services (EWS). The EWS endpoint is identified by AutoDiscover.
The script exports the following columns for further processing:
You can easily adjust the script to fit your requirements. Search for other message subjects and parse for other content in the message body.
# Run script using default parameters
This example shows that P04 and P08 have exceeded the critical and warning state disk performance thresholds more often than the other servers.
The next example shows the same date in a different report.
When you delete a public folder using a legacy Outlook client, you can easily restore the deleted folder and it's content using the Recover Deleted Items function.
Due to a fancy trick implemented in Outlook 2013 and Outlook 2016 the recovered folder will not be recovered using it's full name.
This phenomenon has been verified with Exchange On-Premises and Exchange Online on the server side and Outlook 2013/2016 and Outlook 365 ProPlus.
The following example uses public folders in Exchange Online and Outlook 365 ProPlus.
In this example I will delete and recover a public folder named My Public Folder.
After deletion of My Public Folder and it's content, I need to select the original parent folder and click the Recover Deleted Items button in the button bar.
The Recover Deleted Items dialogue opens and we select the deleted item for recovery. The dialogue displays the original name of the deleted folder.
After recovering the deleted folder the folder is recovered with the first character only.
That's an annoying result in regards to customer self-care when users restore deleted items on their own behalf.
But wait, there is a solution available.
The solution requires today's primary administrative tool available: PowerShell.
Get an overview of public folders currently located in the public folder dumpster
Get-PublicFolder –Identity “\NON_IPM_SUBTREE” –Recurse
Name Parent Path
My Public Folder \NON_IPM_SUBTREE\DUMPSTER_ROOT\DUMPSTER_EXTEND\RESERVED_1\RESERVED_1\65722859-3...
Sub Folder 1 \NON_IPM_SUBTREE\DUMPSTER_ROOT\DUMPSTER_EXTEND\RESERVED_1\RESERVED_1\65722859-3...
Sub Folder 2 \NON_IPM_SUBTREE\DUMPSTER_ROOT\DUMPSTER_EXTEND\RESERVED_1\RESERVED_1\65722859-3...
Export the list of public folders currently located in the public folder dumpster and find the identity of the deleted public folder you want to recover
Get-PublicFolder –Identity “\NON_IPM_SUBTREE” –Recurse | fl | Out-File D:\TMP\publicfolderdumpster.txt
RunspaceId : 6ce9588e-829b-4592-aedc-85f9a2e2c963
Identity : \NON_IPM_SUBTREE\DUMPSTER_ROOT\DUMPSTER_EXTEND\RESERVED_1\RESERVED_1\65722859-366a-4e0
9-81fe-ea576ec7a6f7\My Public Folder
Name : My Public Folder
MailEnabled : False
ParentPath : \NON_IPM_SUBTREE\DUMPSTER_ROOT\DUMPSTER_EXTEND\RESERVED_1\RESERVED_1\65722859-366a-4e0
Recover the deleted public folder to the correct parent target folder
Set-PublicFolder –Identity "\NON_IPM_SUBTREE\DUMPSTER_ROOT\DUMPSTER_EXTEND\RESERVED_1\RESERVED_1\65722859-366a-4e09-81fe-ea576ec7a6f7\My Public Folder" –Path “\TestFolders” –Verbose
As a result the public folder is recovered with it's original name.
There are some other things to consider when recovering deleted modern public folders.
Public folders originally located in the hierarchy root are always recovered to the public folder mailbox holding the primary hierarchy.
Public folders originally located in the hierarchy root will replace the permissions of child public folders when restored.
More on these default restore behaviours can be read here.
Nevertheless, enjoy modern public folders.