Solved

Create Local User account via Command Line

Posted on 2009-03-31
11
2,148 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:lurezero
  • 5
  • 5
11 Comments
 
LVL 10

Expert Comment

by:Darylx
ID: 24030264
/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.
0
 
LVL 5

Assisted Solution

by:trungnt8
trungnt8 earned 100 total points
ID: 24030346
http://support.microsoft.com/kb/251394
/expires:{date | never}
/passwordchg:{yes | no}
0
 
LVL 10

Expert Comment

by:Darylx
ID: 24030428
/expires is for the account expiry, not the password expiry.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:lurezero
ID: 24030531
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?
0
 

Author Comment

by:lurezero
ID: 24030593
so i assume that if the password never expires is not checked is ok?
0
 
LVL 10

Expert Comment

by:Darylx
ID: 24030602
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?
0
 

Author Comment

by:lurezero
ID: 24030638
its a server that belongs to a workgroup....200 local accounts...so i need to config a local GPO?
0
 

Author Comment

by:lurezero
ID: 24030651
i see a maximum password age on the local security policy...what is the value to set it to unlimited?
0
 
LVL 10

Expert Comment

by:Darylx
ID: 24030655
You can configure the local security policy (if you want the password never expires setting to apply to all user accounts on that server).
0
 
LVL 10

Accepted Solution

by:
Darylx earned 400 total points
ID: 24030670
Set the maximum password age to 0 (zero).  That means it will never expire.
0
 

Author Comment

by:lurezero
ID: 24030686
thats what i thought...thanks....
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
search on network drive not working 4 81
Computer software inventory 5 120
DHCP server 6 63
Shared files and folders migration 2 30
I guess it is not common knowledge to most Wintel engineers/administrators: If you have an SNMP-based monitoring system in your environment (and it's common to have SNMP or Syslog) it's reasonably easy to enable monitoring of the Windows Event logs,…
On July 14th 2015, Windows Server 2003 will become End of Support, leaving hundreds of thousands of servers around the world that still run this 12 year old operating system vulnerable and potentially out of compliance in many organisations around t…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question