Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net user for Creating local accounts

Status
Not open for further replies.

kpeterson

IS-IT--Management
Jun 7, 2005
42
CA
Is there a way using the net user command to select the "Password never expires" checkbox on the user properties? For the longest time I though /expires:never was the solution but just recently found out that was for the user account not to expire and had nothing to do with the password. Any help would be great. Thanks
 
The syntax you are looking for is unlimited

/maxpwage:{days | unlimited} : Sets the maximum number of days that a user account's password is valid. The unlimited value sets no maximum time. The /maxpwage command-line option must be greater than /minpwage. The range is from 1 through 49,710 days (that is, unlimited equals 49,710 days), and the default value is 90 days.

I hope 49,710 days is long enough LOL

so for example

net accounts /maxpwage:unlimited

should do the trick.

Bit dangerous though IMHO as no fall back (password expiry) if that account user leaves the company.


 

C:\>net accounts
Force user logoff how long after time expires?: Never
Minimum password age (days): 0
Maximum password age (days): 42
Minimum password length: 0
Length of password history maintained: None
Lockout threshold: Never
Lockout duration (minutes): 30
Lockout observation window (minutes): 30
Computer role: WORKSTATION
The command completed successfully.

==========================
Net accounts

Updates the user accounts database and modifies password and logon requirements for all accounts.

Syntax
net accounts [/forcelogoff:{minutes | no}] [/minpwlen:length] [/maxpwage:{days | unlimited}] [/minpwage:days] [/uniquepw:number] [/domain]

Parameters
/forcelogoff:{minutes | no} : Sets the number of minutes to wait before ending a user's session with a server when the user account or valid logon time expires. The default value, no, prevents users from being forced to log off.

/minpwlen:length : Sets the minimum number of characters for a user account password. The range is from 0 through 127 characters and the default is six characters.

/maxpwage:{days | unlimited} : Sets the maximum number of days that a user account's password is valid. The unlimited value sets no maximum time. The /maxpwage command-line option must be greater than /minpwage. The range is from 1 through 49,710 days (that is, unlimited equals 49,710 days), and the default value is 90 days.

/minpwage:days : Sets the minimum number of days before a user can change a new password. The default value is zero days, which sets no minimum time. The range is from 0 through 49,710 days.

/uniquepw:number : Requires a user to not repeat the same password for the specified number of password changes. The range is from 0 through 24 password changes, and the default is five password changes.

/domain : Performs the operation on the primary domain controller of the current domain. Otherwise, the operation is performed on the local computer.



 
This would work ok but out Group Policy will just change the local policy when ever they are in the office. is there any other way?
 
Computer Configuration. Expand Security Settings, expand Account Polices, click Password Policy. Double-click "Maximum password age" and set to 0 (zero).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top