Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Windows 綜合教學 >> 關於 Windows

Windows 系統強制定期修改密碼:群組原則/命令列/排程工作 三管齊下,建立資安好習慣

編輯:關於 Windows

面對頻繁的資料外洩事件,定期更換密碼是基本防護。Windows 提供三種層級的強制修改機制:群組原則 (專業版以上)、命令列 wmic/net accounts (全版本)、排程工作提醒修改其他服務密碼。並說明 Microsoft 帳戶官網設定 72 天到期、Office/OneDrive 聯動更新。

1. 群組原則 (專業版/企業版/教育版) — 最完整

  1. Win + R → gpedit.msc。
  2. 路徑:電腦設定 → Windows 設定 → 安全性設定 → 帳戶原則 → 密碼原則。
  3. 雙擊 密碼最長使用期限 → 設定天數 (建議 72 天,專家推薦) → 確定。
  4. 同處可設定 密碼最短使用期限、密碼最小長度、密碼必須符合複雜性需求 等。

密碼策略重要性

群組原則密碼原則路徑

設定密碼最長使用期限

複雜性需求設定

2. 命令列 (全版本含家庭版) — 輕量快速

  • 管理員 CMD / PowerShell 執行:
    wmic UserAccount set PasswordExpires=True
    net accounts /maxpwage:72
    (72 可自訂天數,設 0 為永不過期)
  • 僅針對特定帳號:
    wmic UserAccount where Name='YourUserName' set PasswordExpires=True

3. Microsoft 帳戶官網 — 雲端同步

  • 登入 account.microsoft.com → 安全性與隱私 → 變更密碼 → 勾選 讓密碼每 72 天過期。
  • 修改後需在 Windows、Office、OneDrive 等應用重新登入一次生效。

Microsoft 帳戶密碼到期設定

4. 排程工作提醒修改其他服務密碼 (QQ、Line、Email、銀行等)

  1. 控制台 → 系統管理 → 工作排程器 → 建立基本工作。
  2. 名稱:修改 QQ 密碼 → 觸發器:每月、指定日期/時間。
  3. 動作:顯示訊息 → 內容:「請立即修改 QQ 密碼,建議使用密碼管理器產生強密碼」。
  4. 完成 → 到期自動彈出提醒視窗。

建立基本工作

觸發器設定

每月觸發

顯示訊息動作

總結建議

  • 系統登入密碼:群組原則或命令列強制 72-90 天輪換。
  • Microsoft 帳戶:官網啟用 72 天到期。
  • 其他服務:排程工作提醒 + 密碼管理器 (KeePass/Bitwarden/1Password) 統一管理。
  • 記住:前期怕麻煩,後期丟密碼才真的麻煩。
Copyright © Windows教程網 All Rights Reserved