You are on page 1of 3

net user /add useraccountname mypassword net localgroup administrators useraccountname /add net share concfg*C:\\/grant:useraccountname,full net user

useraccountname *

The following example shows the syntax of the net user command: net user [username [password | *] [options]] [/domain] username {password | *} /add [options] [/domain] username [/delete] [/domain] You can use the net user command to create and modify user accounts on computers . When you use this command without command-line switches, the user accounts for the computer are listed. The user account information is stored in the user acc ounts database. This command works only on servers. You can use the following parameters with the net user command: username Is the name of the user account you want to add, delete, modify, or view. Th e name of the user account can have as many as 20 characters. password Assigns or changes a password for the user's account. A password must satisf y the minimum length set with the /minpwlen option of the net accounts command. It can contain as many as 14 characters. * Produces a prompt for the password. The password is not displayed when you t ype it at a password prompt. /domain Performs the operation on the primary domain controller (PDC) of the current domain. This parameter applies only to computers running Windows NT Workstation that are members of a Windows NT Server domain. By default, Windows NT Server-b ased computers perform operations on the PDC. /add Adds a user account to the user accounts database. /delete Removes a user account from the user accounts database. Options for the Net User Command /active:{yes | no} Activates or deactivates the account. If the account is not active, the user cannot gain access to the server. The default is yes. /comment:"text" Provides a descriptive comment about the user's account (maximum of 48 chara cters). Be sure to put quotation marks around the text you use. /countrycode:nnn Uses the operating system country code to implement the specified language f iles for a user's help and error messages. A value of 0 signifies the default co untry code. /expires:{date | never} Causes the account to expire if date is set. The never option sets no time l imit on the account. An expiration date is in the form mm/dd/yy or dd/mm/yy, dep

ending on the country code. Months can be a number, spelled out, or abbreviated with three letters. Year can be two or four numbers. Use slashes (/) with no spa ces to separate parts of the date. /fullname:"name" Is a user's full name (rather than a user name). Enclose the name in quotati on marks. /homedir:pathname Sets the path for the user's home directory. The path must exist. /passwordchg:{yes | no} Specifies whether users can change their own password. The default is yes. /passwordreq:{yes | no} Specifies whether a user account must have a password. The default is yes. /profilepath[:path] Sets a path for the user's logon profile. /scriptpath:pathname Is the location of the user's logon script. /times:{times | all} Is the logon hours. The times option is expressed as day[-day][,day[-day]],t ime[-time][,time [-time]], and is limited to 1-hour increments. Days can be spel led out or abbreviated. Hours can be 12-hour or 24-hour notation. For 12-hour no tation, use am, pm, a.m., or p.m. The all option specifies that a user can alway s log on, and a blank value specifies that a user can never log on. Separate day and time entries with a comma, and separate multiple day and time entries with a semicolon. /usercomment:"text" Lets an administrator add or change the user comment for the account. /workstations:{computername[,...] | *} Lists as many as eight computers from which a user can log on to the network . If the /workstations option has no list or if the list is *, the user can log on from any computer. net help user | more Displays Help one screen at a time.

>>>>>>>>... NET USER options The NET Command is used to manage network resources as follows: options are as follows: /active:{no | yes} Enable or disable the user account. The default is yes (login is allowed) Disabling an account does not immediately log off any user sessions. /comment:"text" A descriptive comment (48 characters). /countrycode:nnn Use the OS country codes to implement specified language files for help and erro r messages. 0 = default country code. /expires:{date | never} Cause the user account to expire. date can be in mm/dd/yy, dd/mm/yy, or mmm,dd,y y format, depending on the /countrycode. Months can be a number, spelled out, or

abbreviated with three letters. Use commas or slashes to separate parts of the date (no spaces). /fullname:"name" The user's full name (rather than a username). /homedir:path The path for the user's home directory. The path must exist. /homedirreq:{yes | no} Is a home directory required? /passwordchg:{yes | no} Can users change their own password? The default is yes. /passwordreq:{yes | no} Must a user account have a password? The default is yes. /profilepath:[path] The path for the user's logon profile. This pathname will be used to store their registry profile. /scriptpath:path Path for the user's logon script. This is relative to %systemroot%\SYSTEM32\REPL \IMPORT\SCRIPTS. (The NETLOGON share) You can't use an absolute path. /times:{times | all} The times the user is allowed to use the computer. The times value is expressed as day[-day][,day[-day]] , time[-time][,time[-time] ], limited to 1-hour time increments. Days can be spelled out or abbreviated (M,T,W,Th,F,Sa,Su). Hours can be 12- or 24-hour notation. For 12-hour notation, use AM, PM, or A.M., P.M. The value all means a user can always log on. A null value (blank) means a user can never log on. Separate day and time with commas, and units of day and time with semicolons (fo r example, M,4AM-5PM;T,1PM-3PM). Do not use spaces when designating /times. /usercomment:"text" Add or change the "User comment" for the account. Only Administrators can edit t his. /workstations:{computername[,...] | *} List as many as eight workstations from which a user can log on to the network. Separate multiple entries in the list with commas. If /workstations has no list, or if the list is *, the user can log on from any computer. Examples NET USER jbloggs apass /ADD /fullname:"Joe Bloggs" /scriptpath:logon.cmd NET USER alice_smith /ACTIVE:yes /comment:"RAS User" /DOMAIN NET USER fred_bloggs /HOMEDIR:\\Server_05\ /PROFILEPATH:\\Server_05\D$\USERS\fre d_bloggs /DOMAIN The only real way to look younger is not to be born so soon - Charles Schulz

You might also like