Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Create Local User account via Command Line

Posted on 2009-03-31
11
Medium Priority
?
2,198 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 400 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
Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

 

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 1600 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

So you have two Windows Servers and you have a directory/folder/files on one that you'd like to mirror to the other?  You don't really want to deal with DFS or a 3rd party solution like Doubletake. You can use Robocopy from the Windows Server 200…
Learn about cloud computing and its benefits for small business owners.
Integration Management Part 2
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

916 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