/build/static/layout/Breadcrumb_cap_w.png

Setting "Password Never Expire" on a local account?

Hi all!

I'm packaging an application where I have to make a few changes on a already existing local account.
The problem I have is to set the account so the "password never expires".

Other things I have to set are: to activate the account and to make so the user so he/she cannot change the password. I solved those things using this command:

NET USER USER_ACCOUNT /PASSWORDCHG:NO /ACTIVE:YES

But as I said, I don't know how to set the password to never expire.
Does anyone know how to solve this matter?
Is there any "hidden" arguments to the "NET USER" command so I can fix that?
Or does anyone any VB script to make that change on a local account?

Regards

JuanK

0 Comments   [ + ] Show comments

Answers (2)

Posted by: WiseUser 18 years ago
Fourth Degree Brown Belt
0
Const ADS_UF_DONT_EXPIRE_PASSWD = &H10000
Dim usr

Set usr = GetObject("WinNT://./MyAccount")
oldFlags = usr.Get("UserFlags")
newFlags = oldFlags Or ADS_UF_DONT_EXPIRE_PASSWD
usr.Put "UserFlags", newFlags
usr.SetInfo

Courtesy of Microsoft:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/winnt_password_never_expires.asp
Posted by: juank 18 years ago
Senior Yellow Belt
0
Thanx dude! [:)] [:)] [:)]

I did create a Custom Action calling the vbscript from embedded code (using Wise Package Sudio) and it worked great!

Regards from Sweden!
[;)]
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ