User creation by command - NET USER

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
alexandredneto
Posts: 39
Joined: 28 Feb 2013 13:40

User creation by command - NET USER

#1 Post by alexandredneto » 29 Jun 2015 08:21

How do I create a local user net user command, and user owned display marking (enabled) field: "User must change password at next logon"?

Compo
Posts: 600
Joined: 21 Mar 2014 08:50

Re: User creation by command - NET USER

#2 Post by Compo » 29 Jun 2015 09:07

Is

Code: Select all

NET USER UserName * /ADD
what you wanted?

alexandredneto
Posts: 39
Joined: 28 Feb 2013 13:40

Re: User creation by command - NET USER

#3 Post by alexandredneto » 29 Jun 2015 10:32

Create the user with parameter to be forced to change the password to login.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: User creation by command - NET USER

#4 Post by Squashman » 29 Jun 2015 10:43

Code: Select all

/logonpasswordchg:yes

My Google Foo is strong.

alexandredneto
Posts: 39
Joined: 28 Feb 2013 13:40

Re: User creation by command - NET USER

#5 Post by alexandredneto » 29 Jun 2015 11:11

D:\>NET USER 12345678901 ABcd@123 /ADD /FULLNAME:"JUAN DA SILVA DIAS" /comment:"CPF 123.456.789-01" /logonpasswordchg:yes
The option /LOGONPASSWORDCHG:yes is unknown.

The syntax of this command is:


NET USER
[username [password | *] [options]] [/DOMAIN]
username {password | *} /ADD [options] [/DOMAIN]
username [/DELETE] [/DOMAIN]

More help is available by typing NET HELPMSG 3506.

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: User creation by command - NET USER

#6 Post by Squashman » 29 Jun 2015 13:23


alexandredneto
Posts: 39
Joined: 28 Feb 2013 13:40

Re: User creation by command - NET USER

#7 Post by alexandredneto » 30 Jun 2015 06:27

It is Windows Server 2003 Standard Edition SP2.
For the company's IT security policy, this link is not available for consultation.
:-(

alexandredneto
Posts: 39
Joined: 28 Feb 2013 13:40

Re: User creation by command - NET USER

#8 Post by alexandredneto » 30 Jun 2015 13:52

I did not succeed to simulate. And you?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: User creation by command - NET USER

#9 Post by foxidrive » 30 Jun 2015 13:55

The article linked above shows that it was introduced and not documented.
It mentions things that will probably explain why it fails.

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: User creation by command - NET USER

#10 Post by Ed Dyreen » 04 Jul 2015 05:57

Not sure this works for localComputer, it just might..
http://windowsitpro.com/windows/netexe-reference

Code: Select all

/minpwlen:<length>    Minimum number of characters for the password. Default is 6, valid range is between 0 and 14
/maxpwage:<days>    Maximum number of days a password is valid. Default is 90, valid range is between 0 and 49710
/minpwage:<days>    Number of days that must occur before the password can be changed. Default is 0, valid range is between 0 and maxpwage
/uniquepw:<number>    Password may not be reused for number attempts
This probably forces all users to change their passwords every day

Code: Select all

net.EXE accounts /minpwage:0 /maxpwage:1
I was looking for a per 'user'/'userGroup' configuration but couldn't find it.

Post Reply