D    The net Commands

You use the net commands to display information about or to manage disk shares, printer shares, and domain user accounts. Users use the net commands to request information about disk shares, printer shares, and domain user accounts.

Windows 95 clients provide net commands that you enter at the MS-DOS prompt. However, these commands only display information about disk shares, printer shares, and domain user accounts and cannot be used to manage them.

You enter net commands in lowercase at the Tru64 UNIX command prompt on a system running ASU software, using the following form:

# net command [/option]

When typing a long command string, do not press the Enter key at the end of the line; continue typing and the text will automatically wrap to the next line on the screen. Press the Enter key after you enter the entire command string.

Table D-1 briefly describes the net commands that you use to administer disk shares, printer shares, and domain user accounts.

Table D-1:  Description of the net Commands

net Command Description
access Displays or modifies resource permissions on ASU servers. Use this command to display and modify permissions on pipes and printer queues. Use the net perms command to manage permissions on all other types of resources.
accounts Displays the role of ASU servers in a domain and displays or modifies password and login user requirements.
admin Runs commands on a remote ASU server.
auditing Displays and modifies the audit settings of a resource.
browser Displays the list of domains that are visible from a local server or the list of computers that are active in a domain.
computer Displays or modifies the list of computer accounts in a domain. This command also can be entered as net computers.
config Displays configuration information or changes the configuration of the ASU server service.
continue Reactivates suspended services; reactivates paused shared printers when entered at a client computer.
device Displays a list of device names and controls shared printers. When used without options, this command displays the status of all shared printers at the specified ASU server. When used with the printer name option, this command displays only the status of the specified printer.
file Displays the names of all open shared files and the number of file locks, if any, on each file. This command can be used to close shared files. When used without options, this command lists all of the open files at an ASU server. This command also can be entered as net files.
group Adds, displays, or modifies global groups. This command can be entered as net groups.
help Provides lists of network commands and topics for which you can get help, or provides help for a specific command or topic.
helpmsg Provides help for a network error message.
localgroup Adds, displays, or modifies local groups in domains. This command also can be entered as net localgroups.
logoff Logs a user account off of the network.
logon Logs a user account in to the domain and sets the user name and password for the user's client. If you do not specify a user name, the default user name is your Tru64 UNIX system login name.
password Changes the password for a user account on an ASU server or in a domain.
pause Suspends a service. The services that can be paused are Alerter, Browser, EventLog, NetLogon, Replicator , Server, and TimeSource.
perms Displays or modifies resource permissions and ownership information on ASU servers. This command operates on shares, directories, and files.
print Displays or controls print jobs and printer queues; also sets or modifies options for a printer queue.
send Sends a message either to connected client computers on the domain or to the entire network.
session Lists or disconnects sessions between an ASU server and clients. When used without options, this command displays information about all of the sessions on the local ASU server. This command also can be entered as net sessions.
share Creates, deletes, modifies, or displays shared resources. Use this command to make a resource available to clients. When used without options, this command displays information about all of the resources being shared on the ASU server.
sid Performs translations between account names and their corresponding security identifiers (SIDs).
start Starts a service or, if used without options, displays a list of services that are running. The services that can be started are Alerter, Browser, EventLog, NetLogon, Replicator, Server, and TimeSource.
statistics Displays or clears the statistics log.
status Displays an ASU server's computer name, configuration settings, and a list of shared resources.
stop Stops a service. The services that can be stopped are Alerter, Browser, EventLog, NetLogon, Replicator, Server, and TimeSource.
time Synchronizes the client's clock with that of an ASU server or domain, or displays the time for an ASU server or domain.
trust Establishes and breaks trust relationships between domains, and lists trust information for a specified domain.
user Adds, modifies, or deletes user accounts or displays user account information.
version Displays the ASU version number on the system on which the command is entered.
view Displays a list of ASU servers or displays the resources being shared by an ASU server.

D.1    Online Help for net Commands

Online help provides details about each net command, including syntax, options, and examples.

To display a list of the net commands for which you can get help, enter:

# net help | more

To display the syntax and options for a particular net command, enter:

# net help command | more

To display a detailed description of the options for the net command you selected, enter:

# net help command/options | more

Table D-2 describes the syntax conventions when viewing online help for the net commands.

Table D-2:  The net Command Syntax Conventions

Symbol Meaning Example

Braces ( { } )

You must choose an option contained within braces.

{yes | no}

You must specify yes or no.

Brackets ( [ ] )

You do not have to choose the option contained within brackets.

[password]

A password may be used with the command, if desired.

Forward slash (/)

The item that follows is an option that should be executed.

net file 1073722830 /close

The file with identification number 1073722830 is to be closed.

Vertical bar ( | )

You have a choice of options that are contained in braces and brackets.

{/hold | /release | /delete}

You can use only one of these options.

Ellipsis ( ...)

You can repeat the previous options.

/route: devicename [, ...]

You can specify more than one device. Separate device names with commas.

Double quotes (" ")

You can type a string of text.

net groups "text"

Displays the information contained within the double quotes.

Pound sign ( # )

You must replace the pound sign with a number.

/users:10

Only 10 users can connect.

D.2    Using Special Characters

Some of the information you supply with a net command may contain a Tru64 UNIX or shell specific special character, for example, an ampersand (&). If you use a special character with a net command, you must precede the special character with the backslash escape character ( \ ). For example, the following command logs a user named peter, whose password is mrkt&dev, in to an ASU server:

# net logon peter mrkt\&dev

Commonly used Tru64 UNIX special characters include:

When you enter net commands that contain special characters from a client computer, surround the strings that contain special characters with double quotes (" ").

D.3    Using Passwords

Some net commands require a password. You can provide a password as a command option by typing it on the same line as the command. For example, to log a user named peter with the password changeme on to an ASU server you would enter:

# net logon peter changeme

Optionally, you can replace the password with an asterisk (*), which causes the system to prompt you for a password. In the Tru64 UNIX operating system, the asterisk ( * ) is a special character and must be preceded by a backslash ( \ ).

For example, to be prompted for a password, enter:

# net logon peter \*

The following message is displayed:

Type your password:

The password is not displayed on the screen as you type.

A password that contains special Tru64 UNIX characters must be enclosed in single quotes when the user logs in. For example, to log in to the ASU server with a user name of peter and a password of !!!!!!!!, enter:

# net logon peter '!!!!!!!!!!'

D.4    Using Command Confirmation

Some net commands require confirmation. For example, if you enter the net logoff command to log off the network with connections to remote shared resources still active, the ASU server displays a prompt similar to the following:

You have the following remote connections: 
LPT1
Continuing will cancel the connections. 
 
Do you want to continue this operation? (Y/N)  [Y]:

You can use the /yes and /no options with any net command to anticipate and respond to a prompt. For example, you are not prompted for confirmation when you enter the following command:

# net logoff /yes

You can use net commands with /yes and /no options to create batch files and shell scripts that are not interrupted by the ASU server prompts.

D.5    Specifying a Path Name

When creating a disk share you must specify a path that consists of a drive letter, which is always c:, and the location of a directory on the server to which the share will map. If the directory does not exist, it will be created provided that you have permission to create the directory.

Separate the drive from the directory specification with one of the following methods:

Each of these commands creates a share called test in the /usr/net/servers/lanman/shares directory on the Tru64 UNIX server.

D.6    Abbreviating net Commands Options

You can abbreviate net command options by typing enough letters to distinguish an option from the other options. However, you cannot abbreviate a value for an option. For example, the net accounts command has the options /forcelogoff:{minutes|no}, /minpwlen:length, /maxpwage:{days|unlimited}, /minpwage:days, and /uniquepw:number. You can enter the net accounts command and abbreviated options as:

# net accounts /f:10 /minpwl:6 /ma:unlimited /minpwa:7 /u:3

Note

Do no abbreviate a net command options in a shell script.

D.7    Administering a Remote ASU Server

You can use the following net admin command to administer a remote ASU server:

# net admin \\servername password /command

The password variable is the administrator's password on the remote ASU server. For example, to create a remote domain user account for a user named peter and a password of changeme, the administrator (using a password of system) of the remote system enters:

# net admin \\server1 system  /command net user peter changeme /add 

The ASU server assigns you administrative privileges when you log in to the Tru64 UNIX system using the root user account, even if you did not specifically log in to the ASU server by using the net logon command.

Having administrative privileges on a local ASU server does not mean that you have the same privileges on a remote ASU server. To remotely manage an ASU server, you must use the net logon command to log in to the domain of which the remote ASU server is part before you can administer it. Otherwise, you will receive an access denied error.

Entering the net logon command on a system configured as an ASU member server logs you into the member server, and not the PDC. To use the net logon command to log in to the PDC, enter:

# net logon administrator password /dom:domain_name.dom

You cannot enter the net logon command from a Windows client to log in to a member server.

D.8    Examples of Using net Command

The following examples show how to use net commands to perform common administrative tasks. These examples assume you are logged in as the administrator to a local ASU server called Server1.

To log on to an ASU server enter the following command:

# net logon username password

To create a domain user account for a user named peter with a password of changeme enter:

# net user peter changeme /add

To place peter's user account in the Domain Admins group enter:

# net group "Domain Admins" peter /add

To view shares on the local ASU server enter:

# net view

To view the shares on a remote ASU server called server2 enter:

# net view \\server2

To create a disk share called plans and map it to the tmp directory enter:

# net share plans=c:/tmp

To create a printer share called print1 that maps to a printer called laser enter:

# net share print1=laser /print

To view the connections to an ASU server enter:

# net session

To view resource permissions and ownership on a directory enter:

# net perms c:/usr/net/servers/lanman/shares