Jump to content

user acounts


Recommended Posts

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 /ADD

net accounts /maxpwage:unlimited

net user Student Password /ADD

net accounts /maxpwage:unlimited

Link to comment
Share on other sites


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 PasswordNeverExpires
cusrmgr.exe -u Student +x CanNotChangePassword +x PasswordNeverExpires

CF

Link to comment
Share on other sites

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

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

:w00t:

CF

Link to comment
Share on other sites

right. I done what you said cancerface but it didnt seem to work.. seee if ive got it correct here

net user Staff Password /ADD
net localgroup "Administrators" /ADD Staff
net accounts /maxpwage:unlimited

wmic.exe UserAccount Where Name="Student" Set PasswordExpires= FALSE, PasswordChangeable= False

net user Student Password /ADD
net accounts /maxpwage:unlimited

wmic.exe UserAccount Where Name="Staff" Set PasswordExpires= FALSE, PasswordChangeable= False

Link to comment
Share on other sites

Shouldn't it be:

net user Staff Password /ADD
net localgroup "Administrators" /ADD Staff
net accounts /maxpwage:unlimited
wmic.exe UserAccount Where Name="Staff" Set PasswordExpires= FALSE, PasswordChangeable= False

net user Student Password /ADD
net accounts /maxpwage:unlimited
wmic.exe UserAccount Where Name="Student" Set PasswordExpires= FALSE, PasswordChangeable= False

It 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 changed

However, 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 by cancerface
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...