Net command usage

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

 
Here we will introduce in detail the most critical net command for intrusion into MS, which will be the most useful for your control system.
Note: IPC is remotely connected using the net command. This is a dangerous remote service. If it does not play a major role, close it as much as possible. This greatly reduces remote threats.

Net accounts
NET Help
NET Share
Net computer
Net helpmsg
Net start
Net config
Net localgroup
Net statistics
Net config Server
Net Name
Net stop
Net config Workstation
Net pause
NET Time
Net continue
Net print
Net use
Net File
Net send
Net user
Net Group
Net session
Net View

Let's take a few practical examples.
-> 1.
Net View
Net view [// computername [/cache] |/domain [: domainname]
Net view/Network: NW [// computername]

Net View
Displays the domain list, computer list, or resources shared by a specified computer.

Net view [// computername |/domain [: domainname]

Net view/Network: NW [// computername]

Parameters

None

If no parameters are available, net view displays the list of computers in the current domain.

// Computername

Specifies the computer on which the shared resources are to be viewed.

/Domain [: domainname]

Specify the domain for which you want to view the available computers. If domainname is omitted, all fields in the network are displayed.

/Network: NW

Displays all available servers on the NetWare network. If a computer name is specified, the available resources on the computer in the NetWare network are displayed. Other networks added to the system can also
Use this switch to specify.

Net View
Example
To view the list of resources shared by // production computers, type:

Net view // Production

To view available resources on the NetWare server // marketing, type:

Net view/Network: NW // Marketing

To view the computer list in the sales domain or workgroup, type:

Net view/domain: Sales

To view all servers in the NetWare network, type:

Net view/Network: NW

Net View
Description
Use the net view command to display the computer list. The display content is similar to the following:

Server Name remark

-------------------------------------------------

// Production File Server

// Print1 printer room, first floor

// Print2 printer room, second floor

-> 2.
Net use

Net use
Connect or disconnect a computer from a shared resource, or display information about the computer connection. This command also controls persistent network connections.

Net use [devicename | *] [// computername/sharename [/volume] [Password | *] [/User: [domainname/] username] [[/delete] |
[/Persistent: {Yes | no}]

Net use devicename [/home [Password | *] [/delete: {Yes | no}]

Net use [/persistent: {Yes | no}]

Parameters

None

If no parameter is specified, net use retrieves the network connection list.

Devicename

Assign a name to connect to the resource or specify a disconnected device. There are two device names: disk drive (D: to Z :) and printer (LPT1: To lpt3 :). Enter an asterisk to replace the specified device name,
Assign the next available device.

// Computername/sharename

Specify the name of the server and shared resource. If computername contains blank characters, the computer name is enclosed by quotation marks ("") from the double backslash (//) to the end of the computer name. Computer
The name can be 1 to 15 characters in length.

/Volume

Specify the NetWare volume on the server. Netware Customer Service (Windows 2000 Professional) or Netware gateway service (Windows 2000 Server) must be installed, and
Connecting to the NetWare server.

Password

Password required to access shared resources.

*

Generate a password prompt line. The password is not displayed when you type the password in the password prompt line.

/User

Specify different user names for establishing a connection.

Domainname

Specify other domains. For example, net use D: // server/share/User: admin/Mariel connects to the user ID Mariel, as if the connection was established from the admin domain. If omitted
The current logon domain is used.

Username

Specifies the username used for logon.

/Delete

Cancels the specified network connection. If you use an asterisk to specify a connection, all network connections are canceled.

/Home

Connect the user to the main directory.

/Persistent

Control the use of persistent network connections. The default value is the last setting. Non-device connections are not persistent.

Yes

Save all connections as they are when they are created, and restore them the next time you log on.

No

Do not save established connections or subsequent connections. The existing connection is restored at the next logon. Use the/delete switch to delete persistent connections.

Net use
Example
To assign the disk drive device name E: To the letters shared directory on the // financial server, type:

Net use E: // financial/Letters

To assign (MAP) the disk drive device name M to the directory Maria in the letters volume on the // financial NetWare server, type:

Net use M: // financial/Letters/Maria

To assign the device name LPT1 to the laser2 shared printer queue on the // accounting server, type:

Net use LPT1: // accounting/laser2

To disconnect from the LPT1 printer queue, type:

Net use LPT1:/delete

To assign the disk drive device name H: To the main directory as the user Mariel, type:

Net use H:/home/User: Mariel

To assign the disk drive device name F to the scratch shared directory of the // financial server, the directory requires the password hctarcs, but does not establish a persistent connection, type:

Net use F: // financial/scratch hctarcs/persistent: No

To disconnect from the // financial/scratch directory, type:

Net use F: // financial/scratch/delete

To connect to the shared resources on the // financial 2 server, type:

Net use K: "// financial 2"/memos

Server names that contain spaces must be enclosed in quotation marks. If quotation marks are omitted, Windows 2000 displays an error message.

To restore the current connection every time you log on without considering future changes, type:

Net use/persistent: Yes

Net use
Description
Use the net use command to connect to or disconnect network resources and view the current connection with network resources. If the shared directory is used as the current drive or is being used by an active process
The shared directory is disconnected.

Obtain the connection information.

To obtain connection information, perform any of the following operations:

Type net use devicename to obtain information about the specified connection.
Type net use to obtain a list of all computer connections.
Non-device connection

Non-device connections are not persistent.

Connect to the NetWare server

After installing and running the Netware Client or gateway service software, you can connect to the NetWare server on the Novell Network. In addition to the volume to be connected
The syntax is the same for Windows network servers.

-> 3.
Net Group
Add, display, or modify global groups in the Windows 2000 Server domain. This command is only available on the Windows 2000 Server domain controller.

Net group [groupname [/comment: "text"] [/domain]

Net group groupname {/Add [/comment: "text"] |/delete} [/domain]

Net group groupname username [...] {/Add |/Delete [/domain]

Parameters

None

Enter the net group command without parameters to display the name of the server and the Group on the server.

Groupname

Name of the group to be added, expanded, or deleted. Only the group name is provided to view the list of users in the group.

/Comment: "text"

Add comments to new or existing groups. The comment can contain up to 48 characters. Enclose the text with quotation marks.

/Domain

Perform operations on the master domain controller of the current domain. Otherwise, the operation is performed on the local computer.

This parameter is only applicable to Windows 2000 Professional computers that are members of the Windows 2000 Server domain. By default, Windows 2000 Server
.

Username

List one or more user names to add to or delete from the group. Separate multiple usernames with spaces.

/Add

Add a group or add a user name to the group. To add a user to a group, you must create an account.

/Delete

Delete a group or user from the group.

Net Group
Example
To display the list of all groups on the local server, type:

Net Group

To add group exec to the local user account database, type:

Net group exec/Add

To add the group exec to the Windows 2000 Server domain user account database on which the Windows 2000 Professional Software computer is installed, type:

Net group exec/Add/Domain

To add an existing user account stevev, ralphr (from the sales domain), and jennyt to the exec group on the Local Computer, type:

Net group exec stevev ralphr jennyt/Add

To add an existing user account stevev, ralphr (from the sales domain), and jennyt to Windows 2000
For the exec Group of the server domain, type:

Net group exec stevev ralphr jennyt/Add/Domain

To display users in the exec group, type:

Net group Exec

To add the remarks to the exec group record, type:

Net group exec/comment: "The executive staff ."

Net Group
Description
You can also enter the net groups command.

Use the net group command to group users using the network in the same or similar way. When you specify permissions for a group, each member of the group automatically obtains these permissions.

The group displayed on the server is similar to the following:

Group accounts for // Production
________________________________________

* Domain Admins * Domain Users

Note that each group name is preceded by an asterisk (*). The asterisks show groups that contain users and groups separately.

-> 4.
Net localgroup
Add, display, or modify a local group.

Net localgroup [groupname [/comment: "text"] [/domain]

Net localgroup groupname {/Add [/comment: "text"] |/delete} [/domain]

Net localgroup groupname [...] {/Add |/delete} [/domain]

Parameters

None

Enter the net localgroup command without parameters to display the name of the server name and Local Group on the computer.

Groupname

Name of the Local Group to be added, expanded, or deleted. Only groupname is provided to view the user list or global groups in the Local Group.

/Comment: "text"

Add comments to new or existing groups. The comment can contain up to 48 characters. Enclose the text with quotation marks.

/Domain

Perform operations on the master domain controller of the current domain. Otherwise, the operation is performed on the local computer.

This parameter is only applicable to Windows 2000 Professional computers that are members of the Windows 2000 Server domain. By default, Windows 2000 Server
.

Name [...]

List one or more user names or group names to add or delete from the local group. Multiple entries are separated by spaces. The name can be a local user, a user in another domain, or a global group, but not a local group. For example
If the user is from another domain, add a domain name (such as sales/ralphr) at the beginning of the user name ).

/Add

Add a global group name or add a user name to the local group. The user or global group must create an account before using this command to join the local group.

/Delete

Delete the group name or user name from the local group.

Net localgroup
Example
To display the list of all local groups on the local server, type:

Net localgroup

To add the Local Group exec to the local user account database, type:

Net localgroup exec/Add

To add the Local Group exec to the Windows 2000 Server domain user account database, type:

Net localgroup exec/Add/Domain

To add an existing user account stevev, ralphr (from the sales domain), and jennyt to the exec Local Group on the Local Computer, type:

Net localgroup exec stevev sales/ralphr jennyt/Add

To add an existing user account stevev, ralphr (from the sales domain), and jennyt to the exec group on the Local Computer, type:

Net localgroup exec stevev ralphr jennyt/Add/Domain

To display users in the exec local group, type:

Net localgroup Exec

To add the comment to the exec local group record, type:

Net localgroup exec/comment: "The executive staff ."

Net localgroup
Description
Use the net localgroup command to group users who use computers or networks in the same or similar way. When you specify permissions for a local group, each member of the Local Group automatically obtains the same permissions.

-> 5.
Net user
Add or modify user accounts or display user account information.

Net user [username [Password | *] [Options] [/domain]

Net user username {password | */Add [Options] [/domain]

Net user username [/delete] [/domain]

Parameters

None

If no parameters are available, the net user displays the list of user accounts on the computer.

Username

User Account name to be added, deleted, modified, or viewed. The user account name can contain a maximum of 20 characters.

Password

Assign or change the password for the user account. The password must meet the minimum length set by the/minpwlen option of the Net accounts command. It can contain a maximum of 127 characters. However
For Windows 2000 computers and Windows 95 or Windows 98 computers, the password must not exceed 14 characters. Maximum Password Length supported by Windows 95 and Windows 98
It must be 14 characters long. If the password is too long, you cannot log on to the network from Windows 98 or Windows 95.

*

Prompt for generating the password. The password is not displayed when you type the password at the password prompt.

/Domain

Perform operations on the master Domain Controller in the master domain of the computer.

This parameter is only applicable to Windows 2000 Professional computers that are members of the Windows 2000 Server domain. By default, Windows 2000 Server
.

Note:

This operation is performed on the master domain controller of the computer's primary domain. This domain may not be an alias domain.
/Add

Add a user account to the user account database.

/Delete

Delete a user account from the user account database.

Options

Specify the following options:

/Active: {No | Yes _

Enable or disable user accounts. If the user account is not active, the user cannot access resources in the computer. The default value is yes ).

/Comment: Text

Provide descriptive descriptions of user accounts. The comment can contain up to 48 characters. Enclose the text with quotation marks.

/Countrycode: NNN

Use the country code of the operating system to implement the specified language file for user help and error messages. The value 0 indicates the default country code.

/Expires: {date | never}

If date is set, the user account will expire; do not set a time limit for the user account. The expiration time format can be mm/DD/YY, dd/mm/yy, mmm, DD, or YY, depending on the country
Home/region code. Note: The account expires at the specified start date. A month can be a number, a spelling, or an abbreviation of three letters. The year can be two or four digits. Separate them with commas (,) and slashes.
Each part of the date (no space is used ). If YY is omitted, it is assumed to be the next occurrence date (based on the date and time of the computer ). For example, if the input date is 1994
The following date items are equal between the 10th day of the month and January 1, January 8, 1995:

Jan, 9
1/9/95
January, 9,1995
1/9

/Fullname: "name"

Specify the user's full name instead of the user name. Enclose the name in quotation marks.

/Homedir: Path

Set the path of the user's main directory. This path must exist.

/Passwordchg: {Yes | no}

Specifies whether users can change their passwords. The default value is yes.

/Passwordreq: {Yes | no}

Specifies whether the user account must have a password. The default value is yes.

/Profilepath: [path]

Set the path of the user login configuration file. This path points to the Registry configuration file.

/Scriptpath: Path

Set the logon script path. The path value cannot be an absolute path; the path is relative to % SystemRoot %/system32/repl/import/scripts.

/Times: {times | all}

Specifies the time when the user is allowed to use the computer. The value of times is day [-day] [, day [-day], time [-time] [, time [-time], and the increment is limited to 1 hour. The date can be spelled or
Abbreviation (M, T, W, Th, F, SA, su ). The hour can be in 12 or 24 notation. For 12-hour notation, use am, PM, A. M., P.

To list Super User Group members, type net localgroup "Power Users" and press Enter. Always include quotation marks.
To list members of a user group, type net localgroup users and press Enter.

To list members in the Administrator group, type net localgroup administrators and press Enter.

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.