Net (command)


In computing, net is a command in IBM OS/2, Microsoft Windows, ReactOS and eComStation used to manage and configure the operating system from the command-line. It is also part of the IBM PC Network Program for DOS.

Overview

The command is primarily used to manage network resources. It is an external command implemented as net.exe. When used in a batch file, the /Y or /N switches can be used to unconditionally answer Yes or No to questions returned by the command. The net command has several sub-commands that can differ from one implementation or operating system version to another.
On Windows CE.NET 4.2, Windows CE 5.0 and Windows Embedded CE 6.0, it is available as an external command stored in. This version only supports the use and view sub-commands.
NameDescriptionDOS supportOS/2 supportWindows supportReactOS supportRemarks
accessManage access
accountsChange Netlogon service role and manage maximum user logon time, password expiration time and other account settings
adminRun administrative command on a remote server
aliasManage aliases currently defined in the domain
appManage information about application definitions
appparmOS/2 Warp 4.5 and eComStation only
auditList and clear contents of the network audit log of the server
commList information about queues for shared serial devices
computerAdd or delete computer from domain database
configDisplay NetBIOS configuration information
continueContinue paused services
copyCopy and append files locally and remotely
dasdManage and display directory limits
deviceList statuses of shared serial devices and stop current use of a device
diagRun the Microsoft Network Diagnostic program
errorList and clear network error log
fileList files opened by remote computers
forwardRoute incoming messages and cancel forwarding
groupAdd, display, or modify global groups in domains
helpDisplay syntax
helpmsgDisplay information on error messages
init
localgroupAdd, display, or modify local groups
logStart/stop saving messages to a file/printer and display information about forwarding the current message log
logoff
logon
moveMove files locally and remotely
nameList or manage NetBIOS names
passwordChange passwords on a server or in a domain
pausePause services
printDisplay printer queue information or print job information, or control print jobsDeprecated in Windows 7 and Windows Server 2008 R2
riplmachOS/2 Warp 4.5 and eComStation only
riplmclasOS/2 Warp 4.5 and eComStation only
run
sendSend messages to other users or computers
separatorControl whether or not a separator page is printed at the beginning of a print file
sessionManage server computer connections
shareManage shared resources
startStart services
statisticsDisplay and clear list of usage statistics for a workstation
statusList information about current network shares and server definition settings
stopStop services
timeDisplay remote computer's current time or sync time with remote computer
useConnect/disconnect computer to/from shared resources, or display information about computer connections
userAdd or modify user accounts, or display user account information
verDisplay information about workgroup redirector
viewDisplay list of domains, computers, or resources shared by specified computers
whoList uses who are logged on current or remote domains, display user logon information, and list users with sessions to a specific server

Example

The net use command has several network-related functions.

Connecting network drive and printer

net use can control mounting drive shares and connecting shared printers in a network environment. This command makes use of the SMB and the NetBIOS protocol on port 139 or 445. The basic Windows XP configuration enables this functionality by default. Thus users can connect to and disconnect from shared resources such as computers, printers and drives.
net use can display a list of network-connection information on shared resources.

Null session connections

net use also connects to the IPC$. This is the so-called null session connection, which allows unauthenticated users.
The basic syntax for connecting anonymously is:

net use \\IP address\IPC$ "" /u:""

For example, typing at the command prompt:

net use \\192.168.1.101\IPC$ "" /u:""

attempts to connect to the share IPC$ of the network 192.168.1.101 as an anonymous user with blank password. If successfully connected to the target machine, a lot of information can be gathered such as shares, users, groups, registry keys and more. This would provide a hacker with a lot of information about a remote user. This has changed in Windows NT 4.0 SP6 already. In Windows 2000 "null session connections" could have been enabled after changes of the system-configuration.

Similar commands in other OSes