設定 SAM 變更密碼 RPC 方法原則 的登錄值 SamrChangeUserPasswordApiPolicy電腦HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\SAM

原則 ID
SamrChangeUserPasswordApiPolicy
適用範圍
電腦設定
支援的作業系統
-
來源
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (版本 1.0)
類別
系統 › 安全性帳戶管理員

登錄

SamrChangeUserPasswordApiPolicy

REG_DWORD電腦
啟用時的值
取決於選項值
元素
Sam 密碼變更 RPC 方法原則的選項:
選項
項目儲存的值
封鎖所有變更密碼 RPC 方法1
只允許增強式加密變更密碼 RPC 方法2
允許所有變更密碼 RPC 方法3
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\SAM]

; 選項 (只使用其中一個)
; 封鎖所有變更密碼 RPC 方法
"SamrChangeUserPasswordApiPolicy"=dword:00000001
; 只允許增強式加密變更密碼 RPC 方法
"SamrChangeUserPasswordApiPolicy"=dword:00000002
; 允許所有變更密碼 RPC 方法
"SamrChangeUserPasswordApiPolicy"=dword:00000003
CMD
:: 選項 (只使用其中一個)

:: 封鎖所有變更密碼 RPC 方法
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\SAM" /v "SamrChangeUserPasswordApiPolicy" /t REG_DWORD /d 1 /f
:: 只允許增強式加密變更密碼 RPC 方法
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\SAM" /v "SamrChangeUserPasswordApiPolicy" /t REG_DWORD /d 2 /f
:: 允許所有變更密碼 RPC 方法
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\SAM" /v "SamrChangeUserPasswordApiPolicy" /t REG_DWORD /d 3 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\SAM' -Force | Out-Null

# 選項 (只使用其中一個)
# 封鎖所有變更密碼 RPC 方法
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\SAM' -Name 'SamrChangeUserPasswordApiPolicy' -PropertyType DWord -Value 1 -Force | Out-Null
# 只允許增強式加密變更密碼 RPC 方法
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\SAM' -Name 'SamrChangeUserPasswordApiPolicy' -PropertyType DWord -Value 2 -Force | Out-Null
# 允許所有變更密碼 RPC 方法
New-ItemProperty -Path 'HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System\SAM' -Name 'SamrChangeUserPasswordApiPolicy' -PropertyType DWord -Value 3 -Force | Out-Null