Actie instellen die bij overschrijding van de aanmeldingsduur moet worden uitgevoerd: registerwaarde LogonHoursActionGebruikerHKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System

Beleids-ID
LogonHoursPolicyDescription
Bereik
Gebruikersconfiguratie
Ondersteund op
Minimaal Windows Vista
Bron
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (versie 1.0)
Categorie
Windows-onderdelen › Windows-aanmeldingsopties

Register

LogonHoursAction

REG_DWORDGebruiker
Waarde bij ingeschakeld
Afhankelijk van de waarde van de optie
Element
Actie instellen die bij overschrijding van de aanmeldingsduur moet worden uitgevoerd
Opties
ItemOpgeslagen waarde
Vergrendelen1
Verbinding verbreken2
Afmelden3
Toepassen met .reg · CMD · PowerShell
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]

; Opties (gebruik er maar één)
; Vergrendelen
"LogonHoursAction"=dword:00000001
; Verbinding verbreken
"LogonHoursAction"=dword:00000002
; Afmelden
"LogonHoursAction"=dword:00000003
CMD
:: Opties (gebruik er maar één)

:: Vergrendelen
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "LogonHoursAction" /t REG_DWORD /d 1 /f
:: Verbinding verbreken
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "LogonHoursAction" /t REG_DWORD /d 2 /f
:: Afmelden
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v "LogonHoursAction" /t REG_DWORD /d 3 /f
PowerShell
# Algemeen: sleutel maken
New-Item -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Force | Out-Null

# Opties (gebruik er maar één)
# Vergrendelen
New-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'LogonHoursAction' -PropertyType DWord -Value 1 -Force | Out-Null
# Verbinding verbreken
New-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'LogonHoursAction' -PropertyType DWord -Value 2 -Force | Out-Null
# Afmelden
New-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\System' -Name 'LogonHoursAction' -PropertyType DWord -Value 3 -Force | Out-Null