密碼設定 的登錄值 PasswordComplexity 等 3 個電腦HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS

原則 ID
LAPS_PasswordSettings
適用範圍
電腦設定
支援的作業系統
至少為 Microsoft Windows 10 或更新版本
來源
Administrative Templates (.admx) for Windows 11 2026 Update (26H2) (版本 1.0)
類別
系統 › 區域系統管理員密碼解決方案 (LAPS)

登錄

PasswordComplexity

REG_DWORD電腦
啟用時的值
取決於選項值
元素
密碼複雜性
選項
項目儲存的值
大寫字母1
大寫字母 + 小寫字母2
大寫字母 + 小寫字母 + 數字3
大寫字母 + 小寫字母 + 數字 + 特殊符號4
大寫字母 + 小寫字母 + 數位 + 特殊 (提高可讀性)5
複雜密碼 (長文字)6
複雜密碼 (簡短文字)7
複雜密碼 (具有唯一前置詞的簡短文字)8
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS]

; 選項 (只使用其中一個)
; 大寫字母
"PasswordComplexity"=dword:00000001
; 大寫字母 + 小寫字母
"PasswordComplexity"=dword:00000002
; 大寫字母 + 小寫字母 + 數字
"PasswordComplexity"=dword:00000003
; 大寫字母 + 小寫字母 + 數字 + 特殊符號
"PasswordComplexity"=dword:00000004
; 大寫字母 + 小寫字母 + 數位 + 特殊 (提高可讀性)
"PasswordComplexity"=dword:00000005
; 複雜密碼 (長文字)
"PasswordComplexity"=dword:00000006
; 複雜密碼 (簡短文字)
"PasswordComplexity"=dword:00000007
; 複雜密碼 (具有唯一前置詞的簡短文字)
"PasswordComplexity"=dword:00000008
CMD
:: 選項 (只使用其中一個)

:: 大寫字母
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS" /v "PasswordComplexity" /t REG_DWORD /d 1 /f
:: 大寫字母 + 小寫字母
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS" /v "PasswordComplexity" /t REG_DWORD /d 2 /f
:: 大寫字母 + 小寫字母 + 數字
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS" /v "PasswordComplexity" /t REG_DWORD /d 3 /f
:: 大寫字母 + 小寫字母 + 數字 + 特殊符號
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS" /v "PasswordComplexity" /t REG_DWORD /d 4 /f
:: 大寫字母 + 小寫字母 + 數位 + 特殊 (提高可讀性)
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS" /v "PasswordComplexity" /t REG_DWORD /d 5 /f
:: 複雜密碼 (長文字)
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS" /v "PasswordComplexity" /t REG_DWORD /d 6 /f
:: 複雜密碼 (簡短文字)
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS" /v "PasswordComplexity" /t REG_DWORD /d 7 /f
:: 複雜密碼 (具有唯一前置詞的簡短文字)
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS" /v "PasswordComplexity" /t REG_DWORD /d 8 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Force | Out-Null

# 選項 (只使用其中一個)
# 大寫字母
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'PasswordComplexity' -PropertyType DWord -Value 1 -Force | Out-Null
# 大寫字母 + 小寫字母
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'PasswordComplexity' -PropertyType DWord -Value 2 -Force | Out-Null
# 大寫字母 + 小寫字母 + 數字
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'PasswordComplexity' -PropertyType DWord -Value 3 -Force | Out-Null
# 大寫字母 + 小寫字母 + 數字 + 特殊符號
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'PasswordComplexity' -PropertyType DWord -Value 4 -Force | Out-Null
# 大寫字母 + 小寫字母 + 數位 + 特殊 (提高可讀性)
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'PasswordComplexity' -PropertyType DWord -Value 5 -Force | Out-Null
# 複雜密碼 (長文字)
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'PasswordComplexity' -PropertyType DWord -Value 6 -Force | Out-Null
# 複雜密碼 (簡短文字)
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'PasswordComplexity' -PropertyType DWord -Value 7 -Force | Out-Null
# 複雜密碼 (具有唯一前置詞的簡短文字)
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'PasswordComplexity' -PropertyType DWord -Value 8 -Force | Out-Null

PasswordLength

REG_DWORD電腦
啟用時的值
取決於選項值
元素
密碼長度
值類型
REG_DWORD
最小值
8
最大值
64
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS]

; 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>
"PasswordLength"=dword:<輸入值>
CMD
:: 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS" /v "PasswordLength" /t REG_DWORD /d "<輸入值>" /f
PowerShell
# 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

New-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'PasswordLength' -PropertyType DWord -Value '<輸入值>' -Force | Out-Null

PasswordAgeDays

REG_DWORD電腦
啟用時的值
取決於選項值
元素
密碼使用期限 (天)
值類型
REG_DWORD
最小值
1
最大值
365
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS]

; 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>
"PasswordAgeDays"=dword:<輸入值>
CMD
:: 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS" /v "PasswordAgeDays" /t REG_DWORD /d "<輸入值>" /f
PowerShell
# 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

New-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'PasswordAgeDays' -PropertyType DWord -Value '<輸入值>' -Force | Out-Null

PassphraseLength

REG_DWORD電腦
啟用時的值
取決於選項值
元素
複雜密碼長度 (文字)
值類型
REG_DWORD
最小值
3
最大值
10
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS]

; 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>
"PassphraseLength"=dword:<輸入值>
CMD
:: 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS" /v "PassphraseLength" /t REG_DWORD /d "<輸入值>" /f
PowerShell
# 值名稱與類型依照 ADMX。請自行填入下方的 <輸入值>

New-Item -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Force | Out-Null
New-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\LAPS' -Name 'PassphraseLength' -PropertyType DWord -Value '<輸入值>' -Force | Out-Null