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

> Source: <https://gist.github.com/asheroto/48337e8451f5a5a01ba2c270426a5350>
> Published: 2025-08-19 16:38:29+00:00

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
