Set User Password to never expire

Hypnotix802

New Member
I've set the net template under post-setup, but it doesn't seem to be working. The box is un-ticked after imaging. This is for the local account created under Unattended. Am I missing something?
 
This is normal behavior. There are two ways to prevent password expiration.

1. Disable expiration (by check box) for each single user.
Code:
wmic UserAccount where Name="Hypnotix802" set PasswordExpires=False

2. Change the global expiration time to unlimited. Everyone's password will expire when "infinity" is reached.
Code:
net accounts /maxpwage:unlimited
 
This is normal behavior. There are two ways to prevent password expiration.

1. Disable expiration (by check box) for each single user.
Code:
wmic UserAccount where Name="Hypnotix802" set PasswordExpires=False

2. Change the global expiration time to unlimited. Everyone's password will expire when "infinity" is reached.
Code:
net accounts /maxpwage:unlimited
Would I just use this as a cmd in the post setup?
 
I just wanted to briefly add, that you can also leave the password blank to remove it entirely. I mention this, because it's not intuitive during the Windows Setup process, when the password screen comes up it's worded in a way that sounds like you must enter a password, but if you click next it'll skip it.

I've seen a lot of people asking about the password expiration setting, so I figured at least some of those people are wanting no password, but are assuming it's not possible and so they ask for no expiration instead.
 
Yeah, I've left it with no password, but it still expires. I've just started to use ntlite to create an image for devices that I sell, just trying to get the hang of it. Lol
 
Yeah, I've left it with no password, but it still expires.
If you're still being prompted to change it, then it's more than likely a setting that is configured incorrectly. If you were to take an unmodified W10 install, manually choose the offline local account option during Windows Setup, and at the password screen just click next to skip it, you will never be prompted about your password again--Windows will automatically sign you in without presenting a password prompt, and it won't expire or notify you about expiration.
 
Last edited:
This is normal behavior. There are two ways to prevent password expiration.

1. Disable expiration (by check box) for each single user.
Code:
wmic UserAccount where Name="Hypnotix802" set PasswordExpires=False

2. Change the global expiration time to unlimited. Everyone's password will expire when "infinity" is reached.
Code:
net accounts /maxpwage:unlimited
Does this look correct?
1675021879887.png
 
I am trying to do the same, but the "UserAccount where Name="username" set PasswordExpires=False" command wont work with an auto created admin account by NTLite. The command work fine when running it as admin in cmd/windows. Any tips?
 
  • Like
Reactions: JQ#
Are you making the same mistake in #8's screen capture?

CommandParameters
wmicUserAccount where Name="Hypnotix802" set PasswordExpires=False
 
Ad a local account in UnAttended section in NTL before Apply your image.
After, endless logons is provided.
1694026049261.png
 

Attachments

  • Local Accout.png
    Local Accout.png
    50.3 KB
As previously noted in post #2, there's usually two questions:
- How do I not expire passwords for everyone? net accounts /maxpwage:unlimited
- How do I not expire passwords for a specific user? wmic UserAccount where Name=

None of them are solved by NTLite's "Add local account" wizard. Or by the Auto logon count.
 
Are you making the same mistake in #8's screen capture?

CommandParameters
wmicUserAccount where Name="Hypnotix802" set PasswordExpires=False
No. For some reason it still wont work. "Post-setup" is runned as administrator? I assume the "Post-Setup" configurations are runned lastly, meaning that the NTLite inbuilt user should already been created?
 
Post-Setup commands run under SYSTEM rights (same as Administrator), and execute after the Unattended instructions for creating new user accounts, and right before the first desktop logon. While the primary user doesn't have their user profile provisioned yet, you should be able to change their password expiration policy at this stage.
 
Back
Top