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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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
Answered 09/02/2005 by: WiseUser
Fourth Degree Brown Belt

Please log in to comment
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!
[;)]
Answered 09/02/2005 by: juank
Senior Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity