PowerShell, Server, Windows

Simulate-Activity: Simulate User Mouse and Keyboard Input with PowerShell

If you want to avoid or block coming up your screensaver take this nice script.
It will move your mouse cursor and presses space every minute to simulate user activity.
This all happens with the help of “Wscript.Shell” for sending a key press and “System.Windows.Forms.Cursor” for moving the cursor for 1 pixel.


If you don’t commit a string for the Minutes parameter it will ask you how many minutes you want to simulate activity:


After that the activity is running for the given amount of time: