Net user add & password expiration

Discussion in 'Windows Server' started by Guilhem, Apr 26, 2006.

  1. Guilhem

    Guilhem Guest

    Hello,

    We are working on a script for Windows 2003 server in standalone. We wanted
    to add a user locally with the password expiration to never and no possiblity
    to modify its password.
    The following command is used:
    net user /ADD "user" /expires:never /passwordchg:no

    This command works on windows 2000 and NT but not on windows 2003. We have
     
    Guilhem, Apr 26, 2006
    #1
    1. Advertisements

  2. Guilhem

    Guilhem Guest

    Sorry I eat some words...

    We are working on a script for Windows 2003 server in standalone. We wanted
    to add a user locally with the password expiration to never and no possiblity
    to modify its password.
    The following command is used:
    net user /ADD "user" /expires:never /passwordchg:no

    This command works on windows 2000 and NT but not on windows 2003. we did
    not find any other options.

    can somebody help us ?
    Thanks in advance

    Guilhem
     
    Guilhem, Apr 26, 2006
    #2
    1. Advertisements

  3. You forgot the password

    /expires:never is for account expiration, NOT password expiration

    See tip 0570 in the 'Tips & Tricks' at http://www.jsifaq.com

    net user /ADD "newuser" "Pass phrase" /passwordchg:no
    netuser "user" /pwnexp:y

    net user newlocaluser
    User name newuser
    Full Name
    Comment
    User's comment
    Country code 000 (System Default)
    Account active Yes
    Account expires Never

    Password last set 04/26/2006 11:59
    Password expires Never
    Password changeable 04/27/2006 11:59
    Password required Yes
    User may change password No

    Workstations allowed All
    Logon script
    User profile
    Home directory
    Last logon Never

    Logon hours allowed All

    Local Group Memberships *Users
    Global Group memberships *None
    The command completed successfully.


    Jerold Schulman
    Windows Server MVP
    JSI, Inc.
    http://www.jsiinc.com
    http://www.jsifaq.com
     
    Jerold Schulman, Apr 26, 2006
    #3
  4. Guilhem

    Guilhem Guest

    In the second command I obtain that the option /pwnexp does not exist ?
    Are you sure ?

    regards,
     
    Guilhem, May 4, 2006
    #4
  5. Guilhem

    Guilhem Guest

    Sorry my eyes was not synchronize with my hands ! :)
    You're right.
    Thanks for your help
     
    Guilhem, May 4, 2006
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.