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
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)
Please log in to answer
Posted by:
WiseUser
19 years ago
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
19 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.