You need to forward incoming emails automatically, but only during your business hours. Manually managing this is time-consuming and error-prone. Outlook rules can filter and manage messages, but they lack a built-in time-based trigger. This article explains how to combine a standard rule with a scheduled task in Windows to forward emails only during a set time window.
Key Takeaways: Forwarding Emails on a Schedule
- Rule > Manage Rules & Alerts > New Rule: Creates the core forwarding rule, which must be turned off by default and activated by a Windows task.
- Task Scheduler > Create Basic Task: Sets up automated triggers to run a script that enables or disables the Outlook rule at specific times.
- Run > Powershell.exe -File: Executes a PowerShell script from the scheduled task to change the rule’s status without opening Outlook.
How Time-Based Forwarding Works in Outlook
Outlook rules are powerful for automating actions like moving or forwarding messages based on sender, subject, or other message properties. However, a significant limitation is the absence of a native condition to run a rule only between 9 AM and 5 PM, for example. The rule engine checks conditions when a new email arrives in your Inbox, not based on the system clock.
To work around this, you use two components. The first is a standard Outlook rule set to forward qualifying emails. You create this rule but leave it in an inactive state. The second component is the Windows Task Scheduler. You create two scheduled tasks: one that runs a script to activate the rule at your chosen start time, and another to deactivate it at your end time. This method requires Outlook to be running for the rule to process new mail, but the script can change the rule’s state even if Outlook is minimized.
Steps to Set Up the Forwarding Rule and Scheduled Tasks
This process involves creating the rule in Outlook, writing a simple PowerShell script, and setting up the automation in Windows Task Scheduler. Ensure Outlook is installed on the computer where you create the scheduled tasks.
Create the Forwarding Rule in Outlook
- Open the Rules Dialog
In Outlook, go to File > Info > Manage Rules & Alerts. Click the New Rule button. - Choose a Template
Select Apply rule on messages I receive under Start from a blank rule. Click Next. - Set Conditions
Choose the conditions for emails you want to forward. For example, check where my name is in the To box to forward emails sent directly to you. Click Next after selecting conditions. - Select the Forwarding Action
Check the box for forward it to people or public group. In the bottom pane, click the underlined people or public group link and enter the recipient’s email address. Click OK, then Next. - Finish and Name the Rule
Click Next through any exceptions screens. Name the rule something clear like Forward During Business Hours. Ensure the box for Turn on this rule is unchecked. Click Finish. The rule will now appear in your rules list but will be inactive.
Create the PowerShell Script to Toggle the Rule
- Open Notepad
Open Windows Notepad or any text editor to write the script. - Write the Script Content
Copy and paste the following script. Replace Forward During Business Hours with the exact name of your rule.$Outlook = New-Object -ComObject Outlook.Application
$Namespace = $Outlook.GetNamespace("MAPI")
$Rules = $Namespace.DefaultStore.GetRules()
$TargetRule = $Rules | Where-Object {$_.Name -eq "Forward During Business Hours"}
$TargetRule.Enabled = $true # Use $false to disable the rule
$Rules.Save() - Save the Script File
Save the file with a .ps1 extension, for example, Enable-ForwardRule.ps1. Save it to a permanent location like C:\Scripts\. Note the full file path.
Schedule the Script in Windows Task Scheduler
- Open Task Scheduler
Type Task Scheduler in the Windows Start menu and open the application. - Create a Basic Task
Click Action > Create Basic Task. Name it Enable Outlook Forward Rule and click Next. - Set the Daily Trigger
Select Daily. Click Next. Set the start time for when forwarding should begin, like 9:00:00 AM. Set it to recur every 1 day. Click Next. - Choose Start a Program
Select Start a program. Click Next. - Configure the Program Script
In the Program/script field, enter Powershell.exe. In the Add arguments field, enter -File “C:\Scripts\Enable-ForwardRule.ps1” using your script’s path. Click Next, then Finish. - Create the Disable Task
Repeat steps 2-5 to create a second task named Disable Outlook Forward Rule. Set its trigger for your end time, like 5:00:00 PM. In the script arguments, use the path to a second script file where the line reads $TargetRule.Enabled = $false.
Common Mistakes and Limitations to Avoid
Rule Does Not Run Because Outlook is Closed
The scheduled script can enable the rule, but the rule only acts on new emails if Outlook is running. The rule cannot forward messages that arrived while Outlook was closed. To ensure it works, confirm Outlook is set to start automatically on system startup or remains open during your forwarding window.
PowerShell Execution Policy Blocks the Script
Windows may block the script due to security restrictions. Open PowerShell as Administrator and run the command Set-ExecutionPolicy RemoteSigned. This allows local scripts to run. Answer Yes to the prompt. This is a one-time configuration for the computer.
Forwarding Loop with Another Rule or Auto-Reply
If the recipient’s mailbox has a rule that auto-replies or forwards messages back to you, it can create an email loop. To prevent this, add an exception to your forwarding rule. When creating the rule, add an exception with except if the subject contains specific words like your own name or a tag like [AutoForwarded].
Manual Rule Toggle vs. Scheduled Automation
| Item | Manual Rule Toggle | Scheduled Automation with Task Scheduler |
|---|---|---|
| Requires User Action | Yes, must remember to enable/disable rule daily | No, runs automatically based on system time |
| Outlook State Dependency | Outlook must be open to change rule state | Script can run with Outlook closed, but rule needs Outlook to process mail |
| Reliability | Prone to human error and forgetfulness | High, as long as Windows is running |
| Setup Complexity | Simple, just create a rule | Moderate, requires script and task creation |
| Best For | Occasional, ad-hoc forwarding periods | Consistent, daily business hour forwarding |
You can now automatically forward emails during specific hours without manual intervention. The combination of an Outlook rule and Windows Task Scheduler handles the time-based activation. For a more advanced setup, explore using conditional formatting to highlight emails that were forwarded during your active window. You can also use the Rules > Manage Rules & Alerts > Change Rule > Edit Rule Settings menu to quickly modify your rule’s conditions without starting from scratch.