互動式登入: 智慧卡移除操作 的登錄值 ScRemoveOption電腦HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon

類別
安全性設定 › 本機原則 › 安全性選項
適用範圍
電腦設定
來源
Windows 11 (版本 26H2 · 26300.9457)

登錄

ScRemoveOption

REG_SZ電腦
啟用時的值
取決於選項值
元素
互動式登入: 智慧卡移除操作
選項
項目儲存的值
沒有動作0
鎖定工作站1
強制登出2
如果是遠端桌面服務工作階段則中斷連線3
無論登入方式為何,都會中斷遠端桌面服務工作階段的連線4
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]

; 選項 (只使用其中一個)
; 沒有動作
"ScRemoveOption"="0"
; 鎖定工作站
"ScRemoveOption"="1"
; 強制登出
"ScRemoveOption"="2"
; 如果是遠端桌面服務工作階段則中斷連線
"ScRemoveOption"="3"
; 無論登入方式為何,都會中斷遠端桌面服務工作階段的連線
"ScRemoveOption"="4"
CMD
:: 選項 (只使用其中一個)

:: 沒有動作
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "ScRemoveOption" /t REG_SZ /d 0 /f
:: 鎖定工作站
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "ScRemoveOption" /t REG_SZ /d 1 /f
:: 強制登出
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "ScRemoveOption" /t REG_SZ /d 2 /f
:: 如果是遠端桌面服務工作階段則中斷連線
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "ScRemoveOption" /t REG_SZ /d 3 /f
:: 無論登入方式為何,都會中斷遠端桌面服務工作階段的連線
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" /v "ScRemoveOption" /t REG_SZ /d 4 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' -Force | Out-Null

# 選項 (只使用其中一個)
# 沒有動作
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'ScRemoveOption' -PropertyType String -Value '0' -Force | Out-Null
# 鎖定工作站
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'ScRemoveOption' -PropertyType String -Value '1' -Force | Out-Null
# 強制登出
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'ScRemoveOption' -PropertyType String -Value '2' -Force | Out-Null
# 如果是遠端桌面服務工作階段則中斷連線
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'ScRemoveOption' -PropertyType String -Value '3' -Force | Out-Null
# 無論登入方式為何,都會中斷遠端桌面服務工作階段的連線
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion\Winlogon' -Name 'ScRemoveOption' -PropertyType String -Value '4' -Force | Out-Null