chiners_68 Posted April 6, 2006 Share Posted April 6, 2006 right.. ive got the following accounts being setup from my RunOnceEX command. how do i set the accounts so the password cannot be changed & account dosent expire..?net user Staff Password /ADDnet accounts /maxpwage:unlimited net user Student Password /ADDnet accounts /maxpwage:unlimited Link to comment Share on other sites More sharing options...
cancerface Posted April 6, 2006 Share Posted April 6, 2006 CUSRMGR.EXE does the trick ...The options that you are looking for are CanNotChangePassword and PasswordNeverExpires so it would look like this:cusrmgr.exe -u Staff +x CanNotChangePassword +x PasswordNeverExpirescusrmgr.exe -u Student +x CanNotChangePassword +x PasswordNeverExpiresCF Link to comment Share on other sites More sharing options...
chiners_68 Posted April 6, 2006 Author Share Posted April 6, 2006 all the documents on CUSRMGR.EXE seem to point to refere to administrator accounts. does it work on normal local accounts too..?can i get a copy of CUSRMGR.EXE put it in my ris install files run the command after the accounts are created & then remove the CUSRMGR.EXE file? Link to comment Share on other sites More sharing options...
cancerface Posted April 6, 2006 Share Posted April 6, 2006 It should work for non-amin accounts.A google search would point you to this page where you can download it IF you have a valid license.CF Link to comment Share on other sites More sharing options...
tguy Posted April 6, 2006 Share Posted April 6, 2006 I have used cusrmgr.exe to change local computer accounts and know it to work the way you would want to use it.Good luck. Link to comment Share on other sites More sharing options...
cancerface Posted April 7, 2006 Share Posted April 7, 2006 I have been playing around with wmic.exe and it appears that you can get the result that you want, without the need for any other (external) tools.In order to disable a user's password (in your case the user was 'Student') from expiring and from being changed you would have to do the following from a command prompt or within some script:wmic.exe UserAccount Where Name="Student" Set PasswordExpires= FALSE, PasswordChangeable= False CF Link to comment Share on other sites More sharing options...
chiners_68 Posted April 12, 2006 Author Share Posted April 12, 2006 right. I done what you said cancerface but it didnt seem to work.. seee if ive got it correct herenet user Staff Password /ADDnet localgroup "Administrators" /ADD Staffnet accounts /maxpwage:unlimited wmic.exe UserAccount Where Name="Student" Set PasswordExpires= FALSE, PasswordChangeable= Falsenet user Student Password /ADDnet accounts /maxpwage:unlimitedwmic.exe UserAccount Where Name="Staff" Set PasswordExpires= FALSE, PasswordChangeable= False Link to comment Share on other sites More sharing options...
cancerface Posted April 12, 2006 Share Posted April 12, 2006 (edited) Shouldn't it be:net user Staff Password /ADDnet localgroup "Administrators" /ADD Staffnet accounts /maxpwage:unlimitedwmic.exe UserAccount Where Name="Staff" Set PasswordExpires= FALSE, PasswordChangeable= Falsenet user Student Password /ADDnet accounts /maxpwage:unlimitedwmic.exe UserAccount Where Name="Student" Set PasswordExpires= FALSE, PasswordChangeable= FalseIt makes sense to first create the account (Student) and then make the password not expire I run the above code in XP and it worked fine I got both accounts and the password is set to not expire + it cannot be changedHowever, I have not tested this from RunOnceEx. I can say that it will not work from cmdlines as WMI is not fully functional at that stage. I have tested CUSRMGR.EXE from both cmdlines and RunOnceEx and I can confirm that it works (see my previous post)CF Edited April 12, 2006 by cancerface Link to comment Share on other sites More sharing options...
chiners_68 Posted April 13, 2006 Author Share Posted April 13, 2006 ooppss, my mistake..I think ill have to call a batch file in runonce for it to set the accounts to not expire etc. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now