Rob van der Woude's Scripting Pages

The NET command

The NET command is used to manage requesters (networked computers), servers and network resources (network drives, printers, etcetera).
Most options of NET.EXE are also available in GUI style programs in Windows and OS/2, but for automating tasks nothing beats the command line interface of NET.EXE and its Windows counterparts.

I "grew up" with OS/2 LAN Server's command line.
I automated many tasks using either batch files with NET.EXE or Rexx scripts with LAN Server RexxUtil.
After jumping on the NT train, it took me a while before I realized that I wasn't condemned to GUI style programs at all, as long as I had access to the Windows NT 4 and 2000 Server Resource Kit utilities.

Being a former OS/2 administrator, the first scripts I created for NT were (Regina) Rexx scripts, written for the Rexx version that came with the Resource Kit.
After a while I switched to batch files combined with Resource Kit utilities.
To my surprise NT's batch language is almost as powerful as a the Resource Kit's Rexx version.

One of the biggest problems when switching from LAN Server to NT is that many of NET.EXE's options have been moved to separate utilities in NT.
The following table and examples are meant as a cross reference: find the "original" LAN Manager/LAN Server command in the column on the left, and check the middle column to see what it translates to in NT.
Note that even when some NET commands remained the same, the options may still differ vastly.
Use NET HELP command to get online help.
In OS/2 you will get even more help on the available options using NET HELP command /O

Windows NT 4's help files contain, amongst others, a very helpful translation table too.
Look at the "Contents", "Windows NT Commands", "What's New or Different from LAN Manager?".

Note:     For NT I added several commands from the free PSTools toolkit.
These tools can be used on local as well as remote systems.
A must-have for Windows administrators.

 

LAN Server/LAN Manager and NT command translation
OS/2, LAN Server
LAN Manager
Windows NT Remarks
AT AT Schedule tasks
NET ACCESS CACLS Manage access.
Alternative (non-native) commands for NT: XCACLS, SHOWACLS, RMTSHARE, SUBINACL, SECEDIT.
NET ACCOUNTS NET ACCOUNTS  
NET ADMIN RCMD (1)
PSEXEC
IMHO NET ADMIN was NT's worst omission.
On the other hand, RCMD (1) and PSEXEC may very well be the best replacements one could ever wish.
NET ADMIN /C \\server NET ACCESS local_path ... XCACLS (1) unc_path ...
PSEXEC \\server CACLS local_path ...
For files only, CACLS can be used on UNC based names as well.
NET ADMIN /C \\domaincontroller NET GROUP globalgroup ... NET GROUP globalgroup ... /DOMAIN  
NET ADMIN /C \\server NET SHARE share ... RMTSHARE (1) \\server\share ...
PSEXEC \\server NET SHARE share ...
 
NET ADMIN /C \\domaincontroller NET USER user_id ... NET USER user_id ... /DOMAIN  
NET ADMIN /C \\server NET FILE ... PSFILE \\server ...  
NET ALIAS None (2)  
NET APP None (2)  
NET APPPARM None (2) OS/2 Warp 4.5 (eComStation) only
NET AUDIT None (2)  
NET COMM None (2)  
None (2) NET COMPUTER  
NET CONFIG NET CONFIG Display NetBIOS configuration information
NET CONTINUE NET CONTINUE Continue paused services
NET COPY COPY
XCOPY
FCOPY (1)
 
NET DASD None (2)  
NET DEVICE None (2)  
NET ERROR DUMPEL (1)
PSLOGLIST
 
NET FILE NET FILE List files opened by remote computers
NET FORWARD None (2)  
NET GROUP NET GROUP
NET LOCALGROUP
List or manage groups and group membership
NET HELP NET HELP
NET HELPMSG
Use NET HELP to display syntax.
Use NET HELPMSG to display information on error messages.
NET LOG None (2)  
NET MOVE None (2)  
NET NAME NET NAME List or manage NetBIOS names
NET PASSWORD NET USER user_id new_password [ /DOMAIN ] The command RUNDLL32.EXE NETPLWIZ.DLL,UsersRunDll will start the GUI for changing passwords (by Administrators only).
Thanks for Steve Pasikowski for pointing out an error in the previously published command ]
NET PAUSE NET PAUSE Pause services
NET PRINT NET PRINT  
NET RIPLMACH None (2) OS/2 Warp 4.5 (eComStation) only
NET RIPLMCLAS None (2) OS/2 Warp 4.5 (eComStation) only
NET RUN RCMD (1)
PSEXEC
 
NET SEND NET SEND Send messages to other users or computers
NET SESSION NET SESSION  
NET SHARE NET SHARE In Windows Server 2003 the default permissions on shares have changed from Everyone Full Control to Everyone Read! Use the /GRANT:Everyone,Full switch to set permissions to the old default.
NET START NET START Start services
NET STATISTICS NET STATISTICS  
NET STATUS NET CONFIG and NET SHARE  
NET STOP NET STOP Stop services
NET TIME NET TIME Synchronize time with a remote computer, or display a remote computer's current time
NET USE NET USE NT's /USER switch makes this command extremely powerful
NET USER NET USER List or manage users
NET VIEW NET VIEW List domains and workgroups (NT's /DOMAIN switch only only), computers, or shared devices
NET WHO None (2) IMHO this is NT's second most important omission.
See NetWho and NetWho2 for an attempt to fill the gap.
For small NT networks PSLOGGEDON may be a viable alternative.

 

Notes: (1) This utility comes with the Windows NT Server Resource Kit
  (2) There seems to be no command line equivalent available in NT.
However, for most tasks GUI style utilities are available in NT.

page last modified: 2011-03-04; loaded in 0.0073 seconds