Link to home
Start Free TrialLog in
Avatar of lurezero
lurezeroFlag for United States of America

asked on

Create Local User account via Command Line

Hi the command to create a local user account is

net user user Password /fullname:"User Name" /add

How to I add the switches so this password will not expire and user cannot change the password?

THanks
Avatar of Daryl Ponting
Daryl Ponting
Flag of United Kingdom of Great Britain and Northern Ireland image

/passwordchg:{yes | no} for changing the password.  I don't know about the password never expires bit.  Maybe you could do that with a GPO.
SOLUTION
Avatar of trungnt8
trungnt8

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
/expires is for the account expiry, not the password expiry.
Avatar of lurezero

ASKER

the password change is working and is showing checked but the password expires:never is not checked when executed. is it supposed to be checked. can you give me a sample with the entire command set?
so i assume that if the password never expires is not checked is ok?
I don't think you can set that option with the net user command.  That's why I said use a GPO or configure the local policy on the computer.  Are you creating the accounts on a PC or server?  Is it a domain PC or Server?
its a server that belongs to a workgroup....200 local accounts...so i need to config a local GPO?
i see a maximum password age on the local security policy...what is the value to set it to unlimited?
You can configure the local security policy (if you want the password never expires setting to apply to all user accounts on that server).
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thats what i thought...thanks....