


This PowerShell script will prevent the “ RPD Session Timeout“, will stop your computer from locking, will disable screensaver and will make your Skype status always online. Disable-Screen-Lock.ps1, that can be executed with the right click and “ Run with PowerShell“. The first line creates a Windows scripting -Com Wscript.Shell object, while the second line creates an infinite loop during which it presses the SCROLLLOCK key (which seems to be useless nowadays) each minute. Simply open the PowerShell and execute the following two lines of code: $WShell = New-Object -Com "Wscript.Shell" So, if you are on a Windows 10 pro PC, and you are able to use group policy editor, then follow the steps given below to let your computer stay online even in sleep mode.

You can also force your computer to stay connected even in sleep mode using local group policy editor. To prevent Windows from locking when idle, to prevent termination of RDP session after timeout and to keep Skype for Business or any other messenger from going inactive, you can simulate key pressing with PowerShell. Method 3: Stay connected to internet in sleep mode using gpedit. In this article i will show how to stop computer from locking and keep the remote desktop session alive without any 3rd party tools and admin privileges, but with just 2 lines in PowerShell.Ĭool Tip: Keyboard key press simulation using Arduino! Read more → Prevent Lock Screen Timeout in Windows This is especially inconvenient when your remote desktop session keeps disconnecting with “ RDP Session Timeout” each time after few minutes of being idle. Corporate Windows computers and servers are usually configured to lock the screen after some time of inactivity.
