Jump to content

Can i set "Password never expires" from nLite somewhere?


Martin H

Recommended Posts

Is there a setting in nLite which will make it so that the password never expires ? I have an admin acount without password, an user account with admin rights also without password and then a guest account. Then after some time, then i get a prompt about the password for my user acount(with admin rights) is expirering soon. I know that i can change it after the install from Windows, or find the needed reg key(s) that controls this setting and then add the reg key(s) to my other reg tweaks which i run from RunOnceEx(those tweaks that nLite dosen't support i.e. disable all Windows sounds/disable delete confirmation dialog etc.), but i would first just check if it was possible to controll from nLite ?

Thank's in advance.

Martin.

Link to comment
Share on other sites


Are you doing an unattended install? No matter, you could still run a cmd file at minute 13 to set up a user. You'd need to create a file, I call mine useraccounts.cmd and place it in the $oem$ folder which is in your root. Here is an example of one I've used before:

useraccounts.cmd

net user Mickey mouse /add
net localgroup Administrators Mickey /add
net accounts /maxpwage:unlimited
REGEDIT /S autologon.reg
EXIT

Note that it creates the user (Mickey) and the password (mouse), puts him in group (here the Administrators Group), and then sets the maximum password age to unlimited which is the same as never expiring. The last item is part of the batch file instructing the merging of a reg file into the registry. That file is merely a command to automatically log the user on X number of times to keep an unattended installation going through reboots. If you want it, the file sits in the same folder and the code looks like:

autologon.reg

Windows Registry Editor Version 5.00 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
"DefaultUserName"="Mickey"
"DefaultPassword"="mouse"
"AutoAdminLogon"="2"

Now I know that this isn't in nLite, but it doesn't have to be.

You mentioned you'd set it up with no password. I know that is "easier" on the face of it, but you need a password to connect a network for one thing, and secondly, you can always use TweakUI to autologon (or set that in the registry yourself), so at the very least you should password the Administrator account. I don't know why MS allow you to have it not passworded, but that's their problem. You shouldn't make it yours. However, you could still set no password above and set maxpwage:unlimited.

Enjoy! :^)

Edited by DonDamm
Link to comment
Share on other sites

Hi DonDamm :)

Thank you very much for your kind help, i really appreciate it :) Sorry about not providing enough information about my process, i completely forgot about that :)

I'm using nLite to integrate Xables XUDPack and make the disc unattended/tweaked and since nLite also supports user creation, then i'm also doing that from inside nLite, instead of from batch files. I hear what you're saying about using passwords, but personally i would rather avoid it, as i have no use of it in my situation. I have just looked again through nLite's user creation dialog and i'm now certain that there isn't an option for defining the password to not expire, but thank's to you then that dosen't matter since i can then just add 'net accounts /maxpwage:unlimited' to my 'cleanup.cmd' file which i run from 'RunOnceEx.cmd' after all my apps have been installed and configured. I am however thinking about something though... When i run 'net accounts /maxpwage:unlimited' from the command line, then i can see that it's working correctly by running 'net accounts' and checking that the passwords maximum age is defined to 'unlimited' now, but when i then go into 'Computer Management' and check the properties of my account, then the checkbox in front of 'Password never expires' isn't checked ? I also rebooted and checked again and still it wasen't checked ? Could you(or anyone else which knows it :)) please tell me if this is normal behaviour and that i shouldn't worry about it ?

Thank's in advance.

CU, Martin.

Link to comment
Share on other sites

Well, I checked and you are right. However, I would tend to trust the command line when it says the command completed successfully. Why it doesn't show in the GUI I don't know. One way to test it is to try one of the other commands like limit it to 2 days and then put your clock forward, or try /minpwage: and set it to maybe 5 days and then try to change the password after. Either should give us a clue as to if it's working.

Also, note that just because the box isn't checked, does not mean it isn't in force! That's an MS thing. :^)

I'm sorry, but I'm not familiar with the netuset tool. What is that? Where do you find it? How is it implemented?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...