---
locale: "en"
updated_at: "2026-03-30T11:59:41.445Z"
canonical: "https://www.isdecisions.com/en/userlock/docs/guides/configuration/set-idle-time"
---

# Set idle time

Configure automatic logoff of inactive sessions.

## Introduction

Idle sessions are a common security and productivity concern, as they can **expose sensitive data** when users leave workstations unlocked.

UserLock can **automatically log off idle user sessions** after a specified duration.

This guide shows how to configure UserLock and Windows to enforce logoff after 20 minutes of inactivity for members of a specific Active Directory group.

## Requirements

Make sure the following prerequisites are met on all target computers:

- ✅ The [UserLock Desktop Agent](/userlock/docs/guides/deploying-agents/desktop-agent) is installed.
- ✅ The screen saver is **protected by password** using the Windows option *“On resume, display logon screen”*. You can easily define this setting for all users through Microsoft Group Policies.

## Step 1. Enable screen saver detection

1. In the **UserLock console**, go to ⚙ **Server settings ▸ General**.
2. Enable the option **“Consider screen saver time as locked time.”**
This ensures UserLock counts screen saver duration as session lock time.
  ![](https://a.storyblok.com/f/122374/893x450/7441bd08fc/idle-time.jpg)
3. Restart the **UserLock Agent Service** (`ULAgentService`) on all target computers.
  > 💡 On Windows XP or Windows Server 2003, a full reboot is required.

> **Note**
>
> **Important:**
> If this step is skipped, the screen saver will trigger a “Lock” event in UserLock but the session will not actually be locked (the user can cancel it during the 5-second grace period).

## Step 2. Create or edit an access policy

1. In the console, open **Access Policies** from the top menu.
2. Edit an existing policy for your **AD group**, or **create a new access policy** (see [Create an access policy](/userlock/docs/getting-started/configuration-access-policy) for detailed steps).
3. In the policy editor, select the **Hours Restrictions** section.
4. Set the option **Maximum locked time** to **Limited to**, then enter the number of minutes of inactivity allowed after the screen saver starts.
  ![](https://a.storyblok.com/f/122374/1048x269/93e87494bf/maximum-locked-time.jpg)

## Example configuration

| Setting | Value |
| --- | --- |
| Screen saver delay | 10 minutes |
| Maximum locked time | 10 minutes |
| Result | ➡️ Logoff after **20 minutes** of total inactivity |

Every session of a user under this policy will be closed after 20 minutes of inactivity (10 minutes before the screen saver starts, plus 10 minutes of locked time).

## User notification

Before the session closes, a **logoff dialog box** appears in the user’s session.

- By default, the notification appears **1 minute** before logoff.
- If you modified the **logoff notification timeout** of the access policy, the dialog box appears accordingly.

See the [Hours Restrictions](/userlock/docs/reference/access-policies/time-restriction#hours-restrictions) reference section for more details on this access policy.
