I've developed an approach to automatically close the Blue Iris desktop application after the computer is idle for X minutes.
(I use X=30 minutes)
EDIT (1/26/2024): attached script updated to V3 (changelog).
Key Point: The Blue Iris service is not terminated when the application is closed.
Using the approach requires the following:
1. [Optional] Editing a PowerShell script to configure your custom idle time. And Pushover settings if you want to receive notifications, like this
2. Executing the PowerShell script every N minutes via Task Scheduler (I use 15 minutes).
Why would you want to use this utility?
1. to reduce the CPU load on the Blue Iris PC.
2. to avoid occasional BI application lock ups when left running unattended for extended periods of time.
======
Caveats
1. Running the PowerShell script from Task Scheduler will result in a flashing PowerShell window when the task runs. This appears to be unavoidable and I have found no work around. The flash is very brief, but you may find it annoying or distracting. I've gotten used to it.
2. After the PowerShell script force closes the Blue Iris application, the Blue Iris icon in the system tray may be "orphaned". Simply mousing over the orphaned icon will cause it go away if the application is not running.
======
Create/configure Task Scheduler task to run the PowerShell script
This topic is described in the comments at the top of the attached PowerShell script.
Tip#1: To make sure the Task Scheduler task is working...
1. Edit the PowerShell scriptstarting at line 184 251 and uncomment the code using msg.exe.
2. Also opt in to sending Pushover notifications.
3. Right-click the task, and select 'Run'.
Note: Once you've confirmed that the task is working, don't forget to return the script to it initial condition.
Tip#2: If you are getting spammed with Pushover notifications, you do not need to delete the task.
Rather, right-click the task and select 'Disable'. Then debug the task and/or script.
======
Using/Testing the PowerShell Script
To experiment with this script, simply
1. Extract the
2. Run the script from a Admin PowerShell window.
The script can also be executed from an Admin cmd.exe window using a command like
NOTE: If you've never used PowerShell on your Blue Iris PC, you may first to need to change its default security policy.
Open PowerShell in Administrator mode, and type the following, then hit the Enter key
(click <here> for a nice beginner's tutorial to using PowerShell).
The following screenshots illustrate the script's output (in a PowerShell window).
1. Usage in 'demo' mode.
2. Usage in normal mode.
(I use X=30 minutes)
EDIT (1/26/2024): attached script updated to V3 (changelog).
Key Point: The Blue Iris service is not terminated when the application is closed.
Using the approach requires the following:
1. [Optional] Editing a PowerShell script to configure your custom idle time. And Pushover settings if you want to receive notifications, like this
2. Executing the PowerShell script every N minutes via Task Scheduler (I use 15 minutes).
Why would you want to use this utility?
1. to reduce the CPU load on the Blue Iris PC.
2. to avoid occasional BI application lock ups when left running unattended for extended periods of time.
======
Caveats
1. Running the PowerShell script from Task Scheduler will result in a flashing PowerShell window when the task runs. This appears to be unavoidable and I have found no work around. The flash is very brief, but you may find it annoying or distracting. I've gotten used to it.
2. After the PowerShell script force closes the Blue Iris application, the Blue Iris icon in the system tray may be "orphaned". Simply mousing over the orphaned icon will cause it go away if the application is not running.
======
Create/configure Task Scheduler task to run the PowerShell script
This topic is described in the comments at the top of the attached PowerShell script.
Code:
# HOW TO AUTOMATE THIS SCRIPT VIA TASK SCHEDULER
# Open Task Scheduler and create an appropriately named task with one triggers and one action:
# Task Scheduler
# 'General' tab
# 'Run only when user is logged in' [REQUIRED] SEE NOTE #1
# 'Run with highest privileges' [REQUIRED] SEE NOTE #2
# 'Triggers' tab:
# 'Daily' or 'One time' (e.g., at 12:05 AM, every 15 minutes)
# (Note: I find 'One time' to be more reliable)
# 'Actions' tab:
# Program/script: powershell.exe
# Add arguments: {your_powershell_scripts_path)\{script_file_name}.ps1
#
# NOTES:
# #1: This setting UNFORTUNATELY results in a flashing PowerShell window when the task runs.
# While this issue can generally be avoided by running the task with setting:
# General tab > 'Run whether user is logged in or not'
# this is not a viable option b/c it causes this script to fail to acquire the desired idle time.
# Therefore, we must use the specified setting.
# #2: 'taskkill' requires administrative privileges to kill a task.
1. Edit the PowerShell script
2. Also opt in to sending Pushover notifications.
3. Right-click the task, and select 'Run'.
Note: Once you've confirmed that the task is working, don't forget to return the script to it initial condition.
Tip#2: If you are getting spammed with Pushover notifications, you do not need to delete the task.
Rather, right-click the task and select 'Disable'. Then debug the task and/or script.
======
Using/Testing the PowerShell Script
To experiment with this script, simply
1. Extract the
BI_app_stop_if_idle.ps1
file from the attached zip file to your desktop, or scripts folder.2. Run the script from a Admin PowerShell window.
The script can also be executed from an Admin cmd.exe window using a command like
powershell.exe "C:\ps_scripts\BI_app_stop_if_idle.ps1"
NOTE: If you've never used PowerShell on your Blue Iris PC, you may first to need to change its default security policy.
Open PowerShell in Administrator mode, and type the following, then hit the Enter key
Set-ExecutionPolicy RemoteSigned
(click <here> for a nice beginner's tutorial to using PowerShell).
The following screenshots illustrate the script's output (in a PowerShell window).
1. Usage in 'demo' mode.
2. Usage in normal mode.
Attachments
Last edited: