cd /news/developer-tools/powershell-script-to-control-monitor… · home topics developer-tools article
[ARTICLE · art-8998] src=gist.github.com ↗ pub= topic=developer-tools verified=true sentiment=· neutral

PowerShell script to control monitor power state: place all displays into standby with -TurnOff or wake them with -TurnOn.

This article describes a PowerShell script called Screen Controller that uses Windows messaging to place all connected displays into standby mode with the `-TurnOff` parameter or wake them with the `-TurnOn` parameter. Unlike tools that fully power off monitors via hardware settings, this script runs entirely in PowerShell without external dependencies and requires a logged-in user session. It is designed for automation through Task Scheduler or Group Policy, such as turning monitors off at 6 PM and waking them at 6 AM.

read1 min views21 publishedAug 19, 2025

Screen Controller (PowerShell) A simple PowerShell script to reliably control monitor/display state. This uses the same method as when a computer display times out through normal power settings. Unlike tools like ControlMyMonitor that change monitor hardware settings and actually power off the monitor, this script uses Windows messaging to place displays into standby (not a full power-off) and runs entirely in PowerShell with no external dependencies. You can wake the screens manually by moving the mouse or pressing a key and allowing a few seconds for them to resume, or wake them remotely through the script. Use -TurnOff to put displays into standby, or -TurnOn to wake them. Usage # Turn monitors off .\ScreenController.ps1 -TurnOff # Wake monitors .\ScreenController.ps1 -TurnOn Or if calling from cmd: # Turn monitors off powershell.exe -ExecutionPolicy Bypass -File .\ScreenController.ps1 -TurnOff # Wake monitors powershell.exe -ExecutionPolicy Bypass -File .\ScreenController.ps1 -TurnOn How it Works TurnOff: Uses Windows messaging to place all connected monitors into standby (not just a black screensaver). TurnOn: Uses Windows messaging to bring the displays back on. A simulated key press has been added for compatibility with systems where the ON command alone may not reliably wake the monitors. Common Use Case Set up with Task Scheduler or Group Policy Preferences to automatically: Turn monitors off at 6 PM Wake monitors at 6 AM Requirements Windows 10/11 PowerShell 5.1 or later Must run in the context of a logged-in user (interactive session), not as SYSTEM

── more in #developer-tools 4 stories · sorted by recency
── more on @powershell 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/powershell-script-to…] indexed:0 read:1min 2025-08-19 ·