CMD-NET command details, net command Daquan

Source: Internet
Author: User
Tags net command net time net send

When Operating Windows 9x/NT/2000/XP/2003, you may encounter one or more problems; in particular, when network administrators maintain the LAN or WAN of the organization, if they can master the network command usage skills of some Windows systems, it will often bring great convenience to their work, and sometimes it can achieve half the result; this article describes how to use net network commands in practice for your reference.

Ben
Text
Master
Yes
Internal
Capacity
Net View Net user Net use NET Time Net start
Net pause Net continue Net stop Net statistics NET Share
Net session Net send Net print Net Name Net localgroup
Net Group Net File Net config Net computer Net accounts

 

We know that the net command is a command line command. The net command has many functions used to utility and verify the NetBIOS connection between computers, you can view information such as the management network environment, service, user, and login. To obtain the net help, you can (1) Use a graphical method in windows, start-> help-> index-> input net; (2) the character type can be used under command: net /? Or net or net help to get the help of the corresponding method. All net commands accept options/Yes and/NO (abbreviated as/y and/N ).

The following describes how to use different parameters of the net command:

1. Net viewi

Usage: displays the list of domains, computers, or shared resources of a specified computer.
Command Format: Net view [\ computername |/domain [: domainname]

Parameter description:

· Enter a net view without parameters to display the computer list of the current domain
· \ Computername specifies the computer on which the shared resources are to be viewed
·/Domain [: domainname] specifies the domain for which you want to view available computers

For example, the shared resource quota of the net viewhttp: // www.cnblogs.com/wyqsht/admin/file://ghq/~ghqcomputer.
Net view/domain: XYZ view the machine list in the XYZ domain.

2. Net user

For use: add or change user accounts or display user account information.
Command Format: Net user [username [Password | *] [Options] [/domain]

Parameter description:

· Enter a net user without parameters to view the user account list on the computer
· Username: add, delete, change, or view user account names
· Password: allocate or change the password for the user account
· Prompt for Password Input
·/Domain: perform operations in the master domain controller of the computer's primary domain. This parameter is only available on Windows NT workstation computers with Windows NT Server domain members. By default, the Windows NT Server computer performs operations on the master domain controller. Note: This action occurs in the master domain controller of the computer's primary domain. It may not be an alias domain.

For example, net user ghq123 can view the information of user ghq123.

3. net use
For use: connect the computer or disconnect the computer from sharing resources, or display the connection information of the computer.

Command Format: net use [devicename | *] [\ computername \ sharename [\ volume] [Password | *] [/User: [domainname \] username] [[/delete] | [/persistent: {Yes | no}]

Parameter description:

· Type net use without parameters to list Network Connections
· Devicename specifies the name of the resource to be connected or the name of the device to be disconnected
· \ Computername \ sharename server and Shared Resource Name
· Password: password used to access Shared Resources
· * The system prompts you to enter the password.
·/User specify another user for connection
· Domainname specifies another domain
· Username indicates the Login User Name
·/Home connects users to their home directories
·/Delete cancel the specified network connection
·/Persistent controls the use of permanent network connections.

For example: net use F: Example
. Net use F: \ GHQ \ Temp/Delete.

4. NET Time

Usage: Synchronize the clock of a computer with the time of another computer or domain.
Command Format: Net time [\ computername |/domain [: Name] [/set]

Parameter description:

· \ Computername: name of the server to be checked or synchronized
·/Domain [: Name] specifies the domain to be synchronized with it
·/Set: Synchronize the clock of the current computer with the clock of the specified computer or domain.

5. Net start

For use: start the service or display the list of started services.
Command Format: Net start service

6. Net pause

For use: Pause a running service.
Command Format: Net pause Service

7. Net continue

For use: reactivate the suspended service.
Command Format: Net continue service

8. net stop

For use: Stop the Windows NT/2000/2003 network service.
Command Format: net stop service

let's take a look at the services included in the above four commands:
(1) Alerter (alert);
(2) client Service for NetWare (Netware Client Service)
(3) ClipBook server
(4) Computer Browser
(5) directory replicator
(6) FTP Hing Service (FTP)
(7) lpdsvc
(8) net Logon
(9) Network DDE
(10) Network dde dsdm (Network dde dsdm)
(11) network Monitor agent (network monitor agent)
(12) Ole (Object link and embedding)
(13) Remote Access Connection Manager (Remote Access Connection Manager)
(14) Remote Access isnsap Service (Remote Access to isnsap)
(15) remote access server (remote access server)
(16) remote Procedure Call (RPC) Locator (Remote Procedure Call Locator)
(17) Remote Procedure Call (RPC) Service (Remote Procedure Call Service)
(18) schedule
(19) server
(20) Simple TCP/IP Services (Simple TCP/IP Service)
(21) snmp
(22) Spooler ( Program printed in the background)
(23) TCP/IP NetBIOS Helper (TCP/IP NetBIOS auxiliary tool)
(24) ups
(25) workstation
(26) Messenger)
(27) DHCP client

9. Net statistics

 

Usage: displays statistics of local workstation or server services.
Command Format: Net statistics [workstation | Server]
Parameter description:

· Enter net statistics without parameters to list available running services
· Workstation displays the statistics of local workstation services
· Server displays statistics of local server services

For example, net statistics server | more displays statistics of server services.

10. NET Share

Usage: creates, deletes, or displays shared resources.
Command Format: net share sharename = drive: path [/users: Number |/unlimited] [/remark: "text"]
Parameter description:

· Enter a net share without parameters to display information about all the shared resources on the local computer.
· Sharename is the Network Name of the shared resource.
· Drive: path specifies the absolute path of the shared directory.
·/Users: number indicates the maximum number of users who can access Shared resources at the same time.
·/Unlimited does not limit the number of users simultaneously accessing shared resources
·/Remark: "text" adds comments about resources. The comments are enclosed in quotation marks.

For example: net share yesky = c: \ Temp/remark: "My first share"
Share c: \ temp with yesky as the sharing name
NET Share yesky/delete stop sharing the yesky directory

11. Net session

Usage: lists or disconnects sessions of local computers and clients connected to them.
Command Format: Net session [\ computername] [/delete]
Parameter description:

· Enter a net session without parameters to display all session information with the local computer.
· \ Computername identifies the computer to list or disconnect sessions.
·/Delete ends the session with the \ computername computer and closes all open files on the computer during the session. If the \ computername parameter is omitted, all sessions with the local computer will be canceled.

For example, net sessionhttp: // www.cnblogs.com/wyqsht/admin/file://ghq/to display the client information of a computer named ghq.

12. Net send

For use: send messages to other users, computers, or communication names on the network.
Command Format: net send {name | * |/domain [: Name] |/users} message
Parameter description:

· Name: the user name, computer name, or communication name of the message to be sent.
· * Send messages to all group names
·/Domain [: Name] send messages to all names in the computer domain
·/Users sends messages to all users connected to the server
· Message as the text sent by the message

For example, net send/users server will shutdown in 10 minutes. send messages to all users connected to the server.

13. Net print

For use: displays or controls print jobs and print queues.
Command Format: Net print [\ computername] job # [/hold |/release |/delete]
Parameter description:

· Computername: name of the computer that shares the printer queue
· Sharename print queue name
· Job # ID assigned to the print job in the printer queue
·/Hold: when job # is used, wait for the print job in the printer queue
·/Release the reserved print job
·/Delete: delete a print job from the printer queue

For example: Net printhttp: // others.

14. Net Name

 

For use: add or delete a message name (sometimes called an alias), or display a list of names of messages received by the computer.
Command Format: Net name [name [/Add |/delete]
Parameter description:

· Enter a net name without parameters to list the currently used names
· Name indicates the name of the received message
·/Add add the name to the computer
·/Delete the name from the computer

15. Net localgroup

For use: add, display, or change a local group.
Command Format: Net localgroup groupname {/Add [/comment: "text"] |/delete} [/domain]
Parameter description:
 
· Enter a net localgroup without parameters to display the server name and the Local Group Name of the computer
· Groupname: name of the Local Group to be added, expanded, or deleted
·/Comment: "text" adds comments to new or existing groups
·/Domain: the operation is performed in the master domain controller of the current domain. Otherwise, the operation is only performed on the local computer.
· Name [...] lists one or more user names or group names to be added to or deleted from a local group.
·/Add: add the global group name or user name to the local group.
·/Delete: Delete the group name or user name from the local group.

For example, net localgroup ggg/Add adds a local group named ggg to the local user account database;
Net localgroup ggg displays the users in the local ggg group.

16. Net Group

For use: add, display, or change global groups in the Windows NT/2000/2003 Server domain.
Command Format: net group groupname {/Add [/comment: "text"] |/delete} [/domain]
Parameter description:

· Type A net group without parameters to display the server name and server group name
· Groupname: group to be added, extended, or deleted
·/Comment: "text" add comments for new or existing groups
·/Domain: this operation is performed in the master domain controller of the current domain. Otherwise, the operation is performed on the local computer.
· The username [...] List displays one or more users to be added to or deleted from the group.
·/Add add a group or add a user name to the group
·/Delete a group or delete a username from the group

For example: net group ggg ghq1 ghq2/Add add existing user accounts ghq1 and ghq2 to the ggg Group of the local computer.

17. Net File

Usage: displays the shared file names opened on a server and the number of locked files.
Command Format: Net file [ID [/close]
Parameter description:

· Enter a net file without parameters to obtain the list of files opened on the server
· ID file ID
·/Close open files and release lock records

18. Net config

Usage: displays the currently running configurable services, or displays and changesSet.
Command Format: Net config [Service [Options]
Parameter description:

· Enter net config without parameters to display the list of configurable services
· Services (server or workstation) configured using the net config command)
· Specific options of the options Service

19. Net computer

For use: add or delete a computer from the domain database.
Command syntax: Net computerhttp: // www.cnblogs.com/wyqsht/admin/file://computername/#/add |/del}
Parameter description:

· \ Computername specifies the computer to be added to or deleted from the domain
·/Add: add the specified computer to the domain
·/Del Delete the specified computer from the domain

For example: Net computerhttp: // www.cnblogs.com/wyqsht/admin/file://js//addadd the computer js to the hosts domain.

20. Net accounts

Usage: updates the user account database, changes the password, and logon requirements for all accounts.
Command syntax: Net accounts [/forcelogoff: {minutes | no}] [/minpwlen: length] [/maxpwage: {days | unlimited}] [/minpwage: days] [/uniquepw: number] [/domain]
Parameter description:

· Enter the Net accounts without parameters to display the current password settings, logon time limit, and Domain Information
·/Forcelogoff: {minutes | no} indicates that when the user account or valid logon time expires
·/Minpwlen: length specifies the minimum number of characters in the password of a user account.
·/Maxpwage: {days | unlimited} sets the maximum number of days for which the user account and password are valid.
·/Minpwage: days indicates the minimum number of days that the user must keep the original password.
·/Uniquepw: Number requires the user to change the password, the same password must be used again after the number is passed
·/Domain: perform this operation on the master domain controller of the current domain.
·/Sync when used for the master domain controller, this command synchronizes all the backup domain controllers in the domain

For example, Net accounts/minpwlen: 8 sets the minimum number of characters of the user account and password to 8.

Of course, the net command is used in the Win98/NT/2000/XP/2003 environment. There may be some differences. Please refer to the relevant information for more information.

The following is an example of combining the net, Ping, and ipconfig commands to test the connectivity of the LAN and determine whether the files and printers of Microsoft network services on a remote computer are shared. The procedure is as follows:

1) first, we need to use the ping command to test the connectivity of TCP/IP, and then use the ipconfig command to display it to ensure that the NIC is not in the "Media disconnected" status.
2) Open the doscommand prompt and use the IP address to ping the host.
If the ping command fails and the "request timed out" message is displayed, verify that the Host IP address is correct, whether the host is running, and whether all the gateways (routers) between the computer and the host are running.
3) to use the ping command to test the host name resolution function, use the host name to ping the required host.
If the ping command fails, the message "unable to resolve target system name" appears. Verify that the host name is correct and that the host name can be resolved by the DNS server.
4) to use the net view command to test the TCP/IP connection, open a command prompt and enter the net view \ computer name. The net view command will list files and print shares on computers that use Windows XP/NT/2000/2003 by establishing a temporary connection. If there is no file or print share on the specified computer, the net view command displays the message "there are no entries in the List.
If the net view command fails and the message "system error 53 has occurred" appears, verify that the computer name is correct and that the Windows XP/NT/2000/2003 computer is running, and whether all the gateways (routers) between the computer and the computer using Windows XP/NT/2000/2003 run.

If the net view command fails, the message "system error 5 has occurred. access is denied." is displayed. Verify that the account you log on to has the permission to view shared permissions on the remote computer.

To further resolve the connectivity problem, perform the following operations:

A) ping the computer name using the ping command.

If the ping command fails and the message "unable to resolve target system name" appears, the computer name cannot be resolved to an IP address.

B) use the net view command and the IP address of the computer running Windows XP/NT/2000/2003, as shown below:

Net viewhttp: // www.cnblogs.com/wyqsht/admin/file://ip/address bar. If the net view command is successful, the computer name is parsed into an incorrect IP address.

If the net view command fails and the message "system error 53 has occurred" appears, it indicates that the remote computer may not share files and printers running Microsoft network services.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.