NET
The syntax of this command is:
NET
[ ACCOUNTS | COMPUTER | CONFIG | CONTINUE | FILE | GROUP | HELP | HELPMSG | LOCALGROUP | PAUSE | SESSION | SHARE | START | STATISTICS | STOP | TIME | USE | USER | VIEW ]
net accounts [/FORCELOGOFF:{minutes | NO}] [/MINPWLEN:length]
[/MAXPWAGE:{days | UNLIMITED}] [/MINPWAGE:days]
[/UNIQUEPW:number] [/DOMAIN]
NET ACCOUNTS updates the user accounts database and modifies password and logon requirements for all accounts.
When used without options, NET ACCOUNTS displays the current settings for password, logon limitations, and domain information.
Two conditions are required in order for options used with NET ACCOUNTS to take effect:
/FORCELOGOFF:{minutes | NO} | Sets the number of minutes a user has before being forced to log off when the account expires or valid logon hours expire. NO, the default, prevents forced logoff. |
/MINPWLEN:length | Sets the minimum number of characters for a password. The range is 0-14 characters; the default is 6 characters. |
/MAXPWAGE:{days | UNLIMITED} | Sets the maximum number of days that a password is valid. No limit is specified by using UNLIMITED. /MAXPWAGE can't be less than /MINPWAGE. The range is 1-999; the default is to leave the value unchanged. |
/MINPWAGE:days | Sets the minimum number of days that must pass before a user can change a password. A value of 0 sets no minimum time. The range is 0-999; the default is 0 days. /MINPWAGE can't be more than /MAXPWAGE. |
/UNIQUEPW:number | Requires that a user's passwords be unique through the specified number of password changes. The maximum value is 24. |
/DOMAIN | Performs the operation on a domain controller of the current domain. Otherwise, the operation is performed on the local computer. |
net computer \\computername {/ADD | /DEL}
NET COMPUTER adds or deletes computers from a domain database. This command is available only on Windows NT Servers.
\\computername | Specifies the computer to add or delete from the domain. |
/ADD | Adds the specified computer to the domain. |
/DEL | Removes the specified computer from the domain. |
net config [SERVER | WORKSTATION]
NET CONFIG SERVER
[/AUTODISCONNECT:time]
[/SRVCOMMENT:"text"]
[/HIDDEN:{YES | NO}]
NET CONFIG displays configuration information of the Workstation or Server service. When used without the SERVER or WORKSTATION switch, it displays a list of configurable services. To get help with configuring a service, type NET HELP CONFIG service.
SERVER | Displays information about the configuration of the Server service. |
WORKSTATION | Displays information about the configuration of the Workstation service. |
net continue service
NET CONTINUE reactivates a Windows service that has been suspended by NET PAUSE.
service | Is the paused service. |
For example, one of the following:
net file [id [/CLOSE]]
NET FILE closes a shared file and removes file locks. When used without options, it lists the open files on a server. The listing includes the identification number assigned to an open file, the pathname of the file, the username, and the number of locks on the file.
This command works only on computers running the Server service.
id | Is the identification number of the file. |
/CLOSE | Closes an open file and removes file locks. Type this command from the server where the file is shared. |
net group
[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname username [...] {/ADD | /DELETE} [/DOMAIN]
NET GROUP adds, displays, or modifies global groups on servers. Used without
parameters, it displays the groupnames on the server.
groupname | Is the name of the group to add, expand, or delete. Supply only a groupname to view a list of users in a group. |
/COMMENT:"text" | Adds a comment for a new or existing group. Enclose the text in quotation marks. |
/DOMAIN | Performs the operation on a domain controller of the current domain. Otherwise, the operation is performed on the local computer. |
username[ ...] | Lists one or more usernames to add to or remove from a group. Separate multiple username entries with a space. |
/ADD | Adds a group, or adds a username to a group. |
/DELETE | Removes a group, or removes a username from a group. |
net help command
-or-
NET command /HELP
Commands available are:
net helpmsg message#
NET HELPMSG displays information about Windows network messages (such as error, warning, and alert messages). When you type NET HELPMSG and the numerical error (for example, "net helpmsg 2182"), Windows tells you about the message and suggests actions you can take to solve the problem.
message# | Is the numerical Windows error with which you need help. |
net localgroup
[groupname [/COMMENT:"text"]] [/DOMAIN]
groupname {/ADD [/COMMENT:"text"] | /DELETE} [/DOMAIN]
groupname name [...] {/ADD | /DELETE} [/DOMAIN]
NET LOCALGROUP modifies local groups on computers. When used without options, it displays the local groups on the computer.
groupname | Is the name of the local group to add, expand, or delete. Supply only a groupname to view a list of users or global groups in a local group. |
/COMMENT:"text" | Adds a comment for a new or existing group. Enclose the text in quotation marks. |
/DOMAIN | Performs the operation on the domain controller of the current domain. Otherwise, the operation is performed on the local workstation. |
name [ ...] | Lists one or more usernames or groupnames to add or to remove from a local group. Separate multiple entries with a space. Names may be users or global groups, but not other local groups. If a user is from another domain, preface the username with the domain name (for example, SALES\RALPHR). |
/ADD | Adds a groupname or username to a local group. An account must be established for users or global groups added to a local group with this command. |
/DELETE | Removes a groupname or username from a local group. |
net pause service
NET PAUSE suspends a Windows service or resource. Pausing a service puts it on hold.
service | Is the service to be paused. |
For example, one of the following:
Also see NET CONTINUE
net session [\\computername] [/DELETE] [/LIST]
NET SESSION lists or disconnects sessions between the computer and other computers on the network. When used without options, it displays information about all sessions with the computer of current focus.
This command works only on servers.
\\computername | Lists the session information for the named computer. |
/DELETE | Ends the session between the local computer and computername, and closes all open files on the computer for the session. If computername is omitted, all sessions are ended. |
/LIST | Displays information in a list rather than a table. |
net share sharename
sharename=drive:path [/GRANT:user,[READ | CHANGE | FULL]] [/USERS:number | /UNLIMITED] [/REMARK:"text"] [/CACHE:Manual | Documents| Programs | BranchCache | None]
sharename [/USERS:number | /UNLIMITED] [/REMARK:"text"] [/CACHE:Manual | Documents | Programs | BranchCache | None] {sharename | devicename | drive:path} /DELETE
sharename \\computername /DELETE
NET SHARE makes a server's resources available to network users. When used without options, it lists information about all resources being shared on the computer. For each resource, Windows reports the devicename(s) or pathname(s) and a descriptive comment associated with it.
sharename | Is the network name of the shared resource. Type NET SHARE with a sharename only to display information about that share. |
drive:path | Specifies the absolute path of the directory to be shared. |
/GRANT:user,perm | Creates the share with a security descriptor that gives the requested permissions to the specified user. This option may be used more than once to give share permissions to multiple users. |
/USERS:number | Sets the maximum number of users who can simultaneously access the shared resource. |
/UNLIMITED | Specifies an unlimited number of users can simultaneously access the shared resource |
/REMARK:"text" | Adds a descriptive comment about the resource. Enclose the text in quotation marks. |
devicename | Is one or more printers (LPT1: through LPT9:) shared by sharename. |
/DELETE | Stops sharing the resource. |
/CACHE:Manual | Enables manual client caching of programs and documents from this share |
/CACHE:Documents | Enables automatic caching of documents from this share |
/CACHE:Programs | Enables automatic caching of documents and programs from this share |
/CACHE:BranchCache | Manual caching of documents with BranchCache enabled from this share |
/CACHE:None | Disables caching from this share |
net start [service]
NET START lists running services.
service
May include one of the following services:
When typed at the command prompt, service names of two words or more must be enclosed in quotation marks. For example, NET START "NET LOGON" starts the net logon service.
NET START can also start services not provided with Windows.
See also NET STOP
SERVER | Displays the Server service statistics. |
WORKSTATION | Displays the Workstation service statistics. |
net stop service
NET STOP stops Windows services.
Stopping a service cancels any network connections the service is using. Also, some services are dependent on others. Stopping one service can stop others.
Some services cannot be stopped.
service May be one of the following services:
NET STOP can also stop services not provided with Windows.
See also NET START
NET TIME synchronizes the computer's clock with that of another computer or domain, or displays the time for a computer or domain. When used without options on a Windows Server domain, it displays the current date and time at the computer designated as the time server for the domain.
\\computername | Is the name of the computer you want to check or synchronize with. |
/DOMAIN[:domainname] | Specifies to synchronize the time from the Primary Domain Controller of domainname. |
/RTSDOMAIN[:domainname] | Specifies to synchronize with a Reliable Time Server from domainname. |
/SET | Synchronizes the computer's time with the time on the specified computer or domain. |
The /QUERYSNTP and /SETSNTP options have been deprecated. Please use w32tm.exe to configure the Windows Time Service.
net use [devicename | *] [\\computername\sharename[\volume] [password | *]]
[/USER:[domainname\]username]
[/USER:[dotted domain name\]username]
[/USER:[username@dotted domain name]
[/SMARTCARD]
[/SAVECRED]
[[/DELETE] | [/PERSISTENT:{YES | NO}]]
NET USE {devicename | *} [password | *] /HOME
NET USE [/PERSISTENT:{YES | NO}]
NET USE connects a computer to a shared resource or disconnects a computer from a shared resource. When used without options, it lists the computer's connections.
devicename | Assigns a name to connect to the resource or specifies the device to be disconnected. There are two kinds of devicenames: disk drives (D: through Z:) and printers (LPT1: through LPT3:). Type an asterisk instead of a specific devicename to assign the next available devicename. |
\\computername | Is the name of the computer controlling the shared resource. If the computername contains blank characters, enclose the double backslash (\\) and the computername in quotation marks (" "). The computername may be from 1 to 15 characters long. |
\sharename | Is the network name of the shared resource. |
\volume | Specifies a NetWare volume on the server. You must have Client Services for Netware (Windows Workstations) or Gateway Service for Netware (Windows Server) installed and running to connect to NetWare servers. |
password | Is the password needed to access the shared resource. |
* | Produces a prompt for the password. The password is not displayed when you type it at the password prompt. |
/USER | Specifies a different username with which the connection is made. |
domainname | Specifies another domain. If domain is omitted, the current logged on domain is used. |
username | Specifies the username with which to logon. |
/SMARTCARD | Specifies that the connection is to use credentials on a smart card. |
/SAVECRED | Specifies that the username and password are to be saved. This switch is ignored unless the command prompts for username and password. |
/HOME | Connects a user to their home directory. |
/DELETE | Cancels a network connection and removes the connection from the list of persistent connections. |
/PERSISTENT | Controls the use of persistent network connections. The default is the setting used last. |
YES | Saves connections as they are made, and restores them at next logon. |
NO | Does not save the connection being made or subsequent connections; existing connections will be restored at next logon. Use the /DELETE switch to remove persistent connections. |
net user [username [password | *] [options]] [/DOMAIN]
username {password | *} /ADD [options] [/DOMAIN]
username [/DELETE] [/DOMAIN]
username [/TIMES:{times | ALL}]
NET USER creates and modifies user accounts on computers. When used without switches, it lists the user accounts for the computer. The user account information is stored in the user accounts database.
username | Is the name of the user account to add, delete, modify, or view. The 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 satisfy the minimum length set with the /MINPWLEN option of the NET ACCOUNTS command. It can have as many as 14 characters. |
* | Produces a prompt for the password. The password is not displayed when you type it at a password prompt. |
/DOMAIN | Performs the operation on a domain controller of the current domain. |
/ADD | Adds a user account to the user accounts database. |
/DELETE | Removes a user account from the user accounts database. |
Options Are as follows:
Options Description
/ACTIVE:{YES | NO} | Activates or deactivates the account. If the account is not active, the user cannot access the server. The default is YES. |
/COMMENT:"text" | Provides a descriptive comment about the user's account. Enclose the text in quotation marks. |
/COUNTRYCODE:nnn | Uses the operating system country code to implement the specified language files for a user's help and error messages. A value of 0 signifies the default country code. |
/EXPIRES:{date | NEVER} | Causes the account to expire if date is set. NEVER sets no time limit on the account. An expiration date is in the form mm/dd/yy(yy). Months can be a number, spelled out, or abbreviated with three letters. Year can be two or four numbers. Use slashes(/) (no spaces) to separate parts of the date. |
/FULLNAME:"name" | Is a user's full name (rather than a username). Enclose the name in quotation 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. |
/LOGONPASSWORDCHG:{YES|NO} | Specifies whether user should change their own password at the next logon.The default is NO. |
/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. TIMES is expressed as day[-day][,day[-day]],time[-time][,time [-time]], limited to 1-hour increments. Days can be spelled out or abbreviated. Hours can be 12- or 24-hour notation. For 12-hour notation, use am, pm, a.m., or p.m. ALL means a user can always log on, and a blank valuemeans 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 /WORKSTATIONS has no list or if the list is *, the user can log on from any computer. |
net view [\\computername [/CACHE] | [/ALL] | /DOMAIN[:domainname]]
NET VIEW displays a list of resources being shared on a computer. When used without options, it displays a list of computers in the current domain or network.
\\computername | Is a computer whose shared resources you want to view. |
/DOMAIN:domainname | Specifies the domain for which you want to view the available computers. If domainname is omitted, displays all domains in the local area network. |
/CACHE | Displays the offline client caching settings for the resources on the specified computer |
/ALL | Displays all the shares including the $ shares |
Top of the Page - Network Commands Home Page
Last Page Update: 30/03/2015
© Sembee Ltd. 1998 - 2024.
Reproduction of any content on this web site is prohibited without express written consent. Use of this web site is subject to our terms and conditions.
All trademarks and registered trademarks are property of their respective owners. This site is not endorsed or recommended by any company or organisation mentioned within and is to provide guidance only and as such we cannot be held responsible for any consequences of following the advice given.
Sembee Ltd. is registered in England and Wales at 1 Carnegie Road, Newbury, Berkshire, RG14 5DJ.
Registered company number: 4704428. VAT Number GB 904 5603 43.
Server 1