Category filter

Script to set Screensaver on Windows

A screensaver is set to turn on after a period of inactivity of the user. It can be used as a medium to display your brand when the screen is idle. It is also used to prevent others from viewing personal content when the user is away for a short while. You can set a screensaver on your Windows devices remotely using Hexnode’s custom script feature.

Note:


Supported Versions:

The scripts given below will be supported on the following versions:

  • Windows 10 v1607+ (Pro, Enterprise, Education)
  • Windows 11 (Pro, Enterprise, Education)

Disclaimer:

The sample scripts provided below are adapted from third-party open-source sites.

Script to set screensaver

Set Screensaver with Windows script executed successfully from Hexnode.

Administrators can provide their own customized screensaver by creating or saving their .scr file (for example, a company logo or branded animation) into a known path such as C:\Windows\System32\. Then they should provide that path in the $ScreensaverPath parameter of the script. In addition, the idle timeout can be set by adjusting the $TimeoutSeconds parameter, which determines how many seconds of inactivity must pass before the screensaver activates.

Optionally, a specific username can be provided through the $TargetUser parameter. If a username is provided, the script applies the screensaver settings only to that user’s registry hive. If no username is given, the script will apply the changes to all users on the device.

How to View Script Output in Hexnode

To review the execution results, navigate to the Action History tab of the specific device in your Hexnode UEM portal. Locate the script entry in the Subject column and click the Show Output button next to the status field to view the returned data.

Notes:

  • The restriction will take effect after the device restarts. You can use the Restart Device action to remotely initiate a device restart.
  • It is recommended to manually validate the script execution on a system before executing the action in bulk.
  • Hexnode will not be responsible for any damage/loss to the system on the behavior of the script.

Sample Script Repository