Page 1 of 1

User creation by command - NET USER

Posted: 29 Jun 2015 08:21
by alexandredneto
How do I create a local user net user command, and user owned display marking (enabled) field: "User must change password at next logon"?

Re: User creation by command - NET USER

Posted: 29 Jun 2015 09:07
by Compo
Is

Code: Select all

NET USER UserName * /ADD
what you wanted?

Re: User creation by command - NET USER

Posted: 29 Jun 2015 10:32
by alexandredneto
Create the user with parameter to be forced to change the password to login.

Re: User creation by command - NET USER

Posted: 29 Jun 2015 10:43
by Squashman

Code: Select all

/logonpasswordchg:yes

My Google Foo is strong.

Re: User creation by command - NET USER

Posted: 29 Jun 2015 11:11
by alexandredneto
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.

Re: User creation by command - NET USER

Posted: 29 Jun 2015 13:23
by Squashman

Re: User creation by command - NET USER

Posted: 30 Jun 2015 06:27
by alexandredneto
It is Windows Server 2003 Standard Edition SP2.
For the company's IT security policy, this link is not available for consultation.
:-(

Re: User creation by command - NET USER

Posted: 30 Jun 2015 13:52
by alexandredneto
I did not succeed to simulate. And you?

Re: User creation by command - NET USER

Posted: 30 Jun 2015 13:55
by foxidrive
The article linked above shows that it was introduced and not documented.
It mentions things that will probably explain why it fails.

Re: User creation by command - NET USER

Posted: 04 Jul 2015 05:57
by Ed Dyreen
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.