-
-
Save inamesh/76c1b92cb2d18b82c822423d480c9e90 to your computer and use it in GitHub Desktop.
A very simple PowerShell script to keep a Windows PC awake and make lync think the user is active on the keyboard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Useful references: | |
# | |
# https://superuser.com/questions/992511/emulate-a-keyboard-button-via-the-command-line | |
# https://ss64.com/vb/sendkeys.html | |
# https://social.technet.microsoft.com/Forums/windowsserver/en-US/96b339e2-e9da-4802-a66d-be619aeb21ac/execute-function-one-time-in-every-10-mins-in-windows-powershell?forum=winserverpowershell | |
# https://learn-powershell.net/2013/02/08/powershell-and-events-object-events/ | |
# | |
# Removed the while loop. The script will be invoked by Task Scheduler either on schedule or basedon the event "4802" from "Security-Auditing" | |
$wsh = New-Object -ComObject WScript.Shell | |
$wsh.SendKeys('+{F15}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment