🔐 Essential Windows Commands for Managing Passwords

Whether you’re a system admin, helpdesk technician, or a curious power user, password management is something you’ll deal with often. Here’s a neat little collection of powerful Windows command-line tools you can use to reset, set, and manage passwords—without opening a single window or GUI.

🔁 1. Reset a Password for an Active Directory User

When you’re working in a domain environment, this command helps reset a user’s password instantly.

net user username newpassword /domain

Example:
net user john.doe P@ssw0rd123 /domain

✅ Requires domain admin rights.


🧑‍💻 2. Reset a Local User’s Password

Want to change the password of a local account on a standalone machine? Use this:

net user username newpassword

Example:
net user Administrator NewSecureP@ss123

Great for resetting the local Administrator or guest account.


🔐 3. Force Password Change at Next Login

If you’re setting a temporary password and want the user to change it after logging in, use:

wmic useraccount where name='username' set PasswordExpires=True

Note: Works for local accounts only.


🔁 Force a Domain User to Change Password at Next Logon (Command-Line)

🖥️ PowerShell Command:

Set-ADUser -Identity username -ChangePasswordAtLogon $true

🔍 Example:

Set-ADUser -Identity john.doe -ChangePasswordAtLogon $true

🚫 4. Disable a User Account Temporarily

Instead of resetting the password, you can just disable the account:

net user username /active:no

Example:

net user john.doe /active:no

Useful if you suspect account misuse or want to suspend access.


✅ 5. Enable a Disabled Account Again

To re-enable it later:

net user username /active:yes

📜 6. List All Local User Accounts

Want to see who’s got an account on the machine?

net user

It lists all local users—useful when you’re unsure of the exact username.

Leave a Comment