Using Powershell to make your screensaver never lock

 


The following script simply toggles the SCROLL-LOCK key every 4 minutes with a .1s double click.

To use: save this as a Powershell script (ending with .ps1) and then run it. Once open, just minimize the script window. It'll still run fine minimized.

clear-host
Echo "Keep alive with scroll lock"
$WShell = New-Object -com "WScript.shell"
while ($True)
{
  $WShell.sendkeys("{SCROLLLOCK}")
  start-sleep -Milliseconds 100
  $WShell.sendkeys("{SCROLLLOCK}")
  start-sleep -Seconds 240
}

Source: https://www.reddit.com/r/sysadmin/comments/th1me3/make_ms_teams_never_show_away_with_this/

Share on Google Plus

About Tom DeMeulenaere

Highly accomplished information technology professional with extensive knowledge in System Center Configuration Manager, Windows Server, SharePoint, and Office 365.
    Blogger Comment

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.