Ustaw limit czasu dla aktywnych sesji usług pulpitu zdalnego: wartość rejestru MaxConnectionTime (HKLM Terminal Services)KomputerHKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services

Identyfikator zasady
TS_SESSIONS_Limits_2
Zakres
Konfiguracja komputera
Obsługiwane w systemach
Systemy operacyjne z rodziny Windows Server 2003 lub nowszej albo system Windows XP Professional
Źródło
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (wersja 1.0)
Kategoria
Składniki systemu Windows › Usługi pulpitu zdalnego › Host sesji pulpitu zdalnego › Limity czasu sesji

Rejestr

MaxConnectionTime

REG_DWORDKomputer
Wartość włączona
Zależy od wartości opcji
Element
Limit sesji aktywnych:
Opcje
PozycjaZapisana wartość
Nigdy0
1 minuta60000
5 minut300000
10 minut600000
15 minut900000
30 minut1800000
1 godzina3600000
2 godziny7200000
3 godziny10800000
6 godzin21600000
8 godzin28800000
12 godzin43200000
16 godzin57600000
18 godzin64800000
1 dzień86400000
2 dni172800000
3 dni259200000
4 dni345600000
5 dni432000000
Zastosuj przez .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services]

; Opcje (użyj tylko jednej)
; Nigdy
"MaxConnectionTime"=dword:00000000
; 1 minuta
"MaxConnectionTime"=dword:0000ea60
; 5 minut
"MaxConnectionTime"=dword:000493e0
; 10 minut
"MaxConnectionTime"=dword:000927c0
; 15 minut
"MaxConnectionTime"=dword:000dbba0
; 30 minut
"MaxConnectionTime"=dword:001b7740
; 1 godzina
"MaxConnectionTime"=dword:0036ee80
; 2 godziny
"MaxConnectionTime"=dword:006ddd00
; 3 godziny
"MaxConnectionTime"=dword:00a4cb80
; 6 godzin
"MaxConnectionTime"=dword:01499700
; 8 godzin
"MaxConnectionTime"=dword:01b77400
; 12 godzin
"MaxConnectionTime"=dword:02932e00
; 16 godzin
"MaxConnectionTime"=dword:036ee800
; 18 godzin
"MaxConnectionTime"=dword:03dcc500
; 1 dzień
"MaxConnectionTime"=dword:05265c00
; 2 dni
"MaxConnectionTime"=dword:0a4cb800
; 3 dni
"MaxConnectionTime"=dword:0f731400
; 4 dni
"MaxConnectionTime"=dword:14997000
; 5 dni
"MaxConnectionTime"=dword:19bfcc00
CMD
:: Opcje (użyj tylko jednej)

:: Nigdy
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 0 /f
:: 1 minuta
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 60000 /f
:: 5 minut
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 300000 /f
:: 10 minut
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 600000 /f
:: 15 minut
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 900000 /f
:: 30 minut
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 1800000 /f
:: 1 godzina
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 3600000 /f
:: 2 godziny
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 7200000 /f
:: 3 godziny
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 10800000 /f
:: 6 godzin
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 21600000 /f
:: 8 godzin
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 28800000 /f
:: 12 godzin
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 43200000 /f
:: 16 godzin
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 57600000 /f
:: 18 godzin
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 64800000 /f
:: 1 dzień
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 86400000 /f
:: 2 dni
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 172800000 /f
:: 3 dni
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 259200000 /f
:: 4 dni
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 345600000 /f
:: 5 dni
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v "MaxConnectionTime" /t REG_DWORD /d 432000000 /f
PowerShell
# Wspólne: utwórz klucz
New-Item -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Force | Out-Null

# Opcje (użyj tylko jednej)
# Nigdy
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 0 -Force | Out-Null
# 1 minuta
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 60000 -Force | Out-Null
# 5 minut
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 300000 -Force | Out-Null
# 10 minut
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 600000 -Force | Out-Null
# 15 minut
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 900000 -Force | Out-Null
# 30 minut
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 1800000 -Force | Out-Null
# 1 godzina
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 3600000 -Force | Out-Null
# 2 godziny
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 7200000 -Force | Out-Null
# 3 godziny
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 10800000 -Force | Out-Null
# 6 godzin
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 21600000 -Force | Out-Null
# 8 godzin
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 28800000 -Force | Out-Null
# 12 godzin
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 43200000 -Force | Out-Null
# 16 godzin
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 57600000 -Force | Out-Null
# 18 godzin
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 64800000 -Force | Out-Null
# 1 dzień
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 86400000 -Force | Out-Null
# 2 dni
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 172800000 -Force | Out-Null
# 3 dni
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 259200000 -Force | Out-Null
# 4 dni
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 345600000 -Force | Out-Null
# 5 dni
New-ItemProperty -Path 'HKLM:\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services' -Name 'MaxConnectionTime' -PropertyType DWord -Value 432000000 -Force | Out-Null