Skip to main content

GPO - Create Screen Lock Policy Globals

Summary​

This script uses global variables to configure the number of seconds before a screen locks. By default, this script imports with this set at 900 seconds. This setting can be configured in the script's global variables section if your best practices differ from the ones configured in the script.

Time Saved by Automation: 5 Minutes

Sample Run​

Sample Run

Dependencies​

The script must be run against the Windows Domain Controllers.

Variables​

Variable NameDescription
Timeout-SecondsThis variable defines the number of seconds before a screen locks. By default, it is set to 900 seconds.

Global Parameters​

NameExampleRequiredDescription
Apply to entire domain1TrueThis option helps to decide whether it is required to apply to the entire domain or not.

Process​

This script uses global variables to configure the number of seconds before a screen locks. By default, this script imports with this set at 900 seconds. This setting can be configured in the script's global variables section if your best practices differ from the ones configured in the script. The script runs two PowerShell scripts to create a GPO based on the parameters set in the script. If the parameter Apply to entire domain is null, the GPO will not link to the entire domain, and vice versa.

Output​

  • Script log

Changelog​

2025-04-10​

  • Initial version of the document