Change Screensaver Time

SOTI MobiControl
Windows

A screensaver activates after a period of user inactivity, helping protect unattended devices from potential intruders. It prevents unauthorized access to personal files and can also serve as a branding tool when idle. With SOTI MobiControl's send script action, you can set a delay before the preset screensaver starts.

Important:
  • It is recommended to test the script on a local/ test machine for its purpose and effects. 
  • SOTI MobiControl will not be responsible for any damage/loss to the data/setup based on the behavior of the script.

Change screensaver time

1 param(
2 [int]$timeLimit =20
3 )
4 try
5 {
6 if($timeLimit)
7 {
8 "changing machine inactivity limit to "+ $timeLimit + " seconds"
9 $path = 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\'
10 $name = 'InactivityTimeoutSecs'
11 Set-ItemProperty -Path $path -Name $name -Value $timeLimit
12 "-----inactivity limit successfully updated-----"
13 }
14 else
15 {
16 "-----------please provide machine inactivity limit as argument (in seconds)-----------"
17 }
18 }
19 catch {
20 Write-Output $_.Exception.Message
21 }

Was this helpful?

Need more help?
Ask Community