From cda5aee714a650c5d3fe27fea3ae8cf67d71bb10 Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Tue, 11 Jul 2023 11:12:12 -0700 Subject: [PATCH] Add option to disable password expiration --- scripts/auto_setup.py | 1 + scripts/wk/setup/win.py | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/scripts/auto_setup.py b/scripts/auto_setup.py index d3712d69..7497439b 100644 --- a/scripts/auto_setup.py +++ b/scripts/auto_setup.py @@ -43,6 +43,7 @@ BASE_MENUS = { ), 'Configure System': ( MenuEntry('Open Shell', 'auto_config_open_shell'), + MenuEntry('Disable Password Expiration', 'auto_disable_password_expiration'), MenuEntry('Enable BSoD MiniDumps', 'auto_enable_bsod_minidumps'), MenuEntry('Enable RegBack', 'auto_enable_regback'), MenuEntry('Enable System Restore', 'auto_system_restore_enable'), diff --git a/scripts/wk/setup/win.py b/scripts/wk/setup/win.py index e74e0d5c..5c75037e 100644 --- a/scripts/wk/setup/win.py +++ b/scripts/wk/setup/win.py @@ -426,6 +426,11 @@ def auto_config_open_shell() -> None: TRY_PRINT.run('Open Shell...', config_open_shell) +def auto_disable_password_expiration() -> None: + """Disable password expiration for all users.""" + TRY_PRINT.run('Disable password expiration...', disable_password_expiration) + + def auto_export_aida64_report() -> None: """Export AIDA64 reports.""" TRY_PRINT.run('AIDA64 Report...', export_aida64_report) @@ -620,6 +625,12 @@ def disable_chrome_notifications() -> None: pref_file.write_text(json.dumps(pref_data, separators=(',', ':'))) +def disable_password_expiration() -> None: + """Disable password expiration for all users.""" + cmd = ['wmic', 'UserAccount', 'set', 'PasswordExpires=False'] + run_program(cmd) + + def enable_bsod_minidumps() -> None: """Enable saving minidumps during BSoDs.""" cmd = ['wmic', 'RECOVEROS', 'set', 'DebugInfoType', '=', '3']