Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP 9000 Networking: Advanced Server/9000 Administrator's Guide > Chapter 1 Administering Advanced Server at the Command Prompt

Net Command

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

Although we recommend that you use the programs available through Windows NT Administrative Tools and Windows NT Server Tools to administer Advanced Server, the Net command-line interface also can be used. Refer to the Advanced Server/9000 Quick Installation Guide for details on which computers to install the Windows NT Administrative Tools and Windows NT Server Tools on.

You are automatically granted the Administrator privilege if you run net commands as root even if you are logged in to AS/U as a non-administrative user. This is so you can perform administrative actions (like stopping the server) without having to log in as an administrative user.

The following sections summarize the net commands that are available in Advanced Server and describes syntax and usage conventions.

Administering Local and Remote Servers

When you administer a server while you are working at the server command prompt, that server is called the local server. If you are administering a server from the command prompt of another server, the server being administered is called the remote server.

Some of your network users may be designated as account operators, print operators, or server operators. These users have limited administrative or operator privileges that enable them to perform specific tasks. These privileges are sufficient to use the net command to administer a local server at the Advanced Server command prompt.

However, to use the net command to administer a remote Advanced Server, you must be logged on to Advanced Server as an Administrator with full administrative privilege. If you have different operators responsible for parts of your network and you do not want to assign them full administrative privilege, then they must work only at the Advanced Server command prompt of the server being administered.

Administering a Local Advanced Server

To administer a local Advanced Server using the Net command

  1. Log on to the UNIX system hosting the Advanced Server.

  2. At the UNIX system prompt, log on to the network as Administrator or as a user with administrative privileges by typing the following command:

    net logon username password 
  3. Enter the appropriate Net command. For example, to display a list of the server's shared resources, type net share.

NOTE: Remember to log off when you are finished administering Advanced Server.

Administering a Remote Advanced Server

To perform server administration tasks using the Net command remotely, use the net admin command and the appropriate Net command for the task. Step 2 of the following procedure describes two ways of entering the net admin command.

To enter a Net command remotely

  1. Log on to the network as Administrator or as a user with administrative privileges. (Operator privileges are not sufficient to perform this procedure.)

  2. Enter the net admin command using one of the following methods:

    • Enter a separate net admin command for each Net command you wish to execute. For example, to display statistics for a server named account, type the following:

      	net admin \\account /command net statistics server

      This method is useful for batch files.

    • Enter a net admin command followed by multiple net commands. For example, to execute multiple net commands on a server named payroll, type the following:

      	net admin \\payroll /command

    This creates an administrative command shell from which you subsequently can issue Net commands. The prompt changes to include the name of the server you are remotely administering, for example, \\payroll.

    Any Net command that you type at this prompt executes on the server that you specify. For example, at the prompt, type:

    [\\payroll] net share
    [\\payroll] net print

    where \\payroll is the prompt, and net share and net print are the commands.

To exit the command shell and return to the system prompt, type exit or press CTRL+Z.

NOTE: Net commands which take a domain or computer name as an option can be used for administering remote servers. This type of administration can be performed directly at the UNIX system command prompt without using the net admin command. For example, to display local groups on a remote domain named market_dom, you would type net localgroup /domain:market_dom.

Paging Through Screens

Some displays provide more than one screen full of information. For example, the following command provides several screens of information on the net share command:

net help share /options

To display information one screen at a time, use the more command, for example:

net help share /options |more

After you have examined one screen of information and are ready to proceed, press the SPACEBAR to display the next screen of text.

Using Passwords With Commands

Some commands require a password as an option. You can provide a password as a command option by typing the password on the same line as the command itself. For example, to log the user name jim with the password kahuna on the network, you would type:

net logon jim kahuna

You can also ask the Advanced Server to prompt you for your password, replacing the password with an asterisk ( * ) when you type the command.

NOTE: In the UNIX operating system, the asterisk ( * ) is a special character and must be preceded by a back slash ( \ ).

For example, to use the same resource described above, type:

net logon jim \*

The Advanced Server then displays the following message:

Type your password:

When you enter a password at this prompt, the password does not appear on the screen as you type. This allows you to keep your password confidential, providing added security.

If you forget to type a password with a command that requires one, the Advanced Server prompts you for it. Depending on the command that you type, the Advanced Server also may prompt you for other pertinent information such as your user name.

Using Command Confirmation

Some Net commands require confirmation. The /yes and /no options help expedite Net commands. When Advanced Server reads one of these options, it does not pause to display the corresponding prompt. Instead, Advanced Server accepts the /yes or /no option as your response to the prompt.

You can use Net commands with /yes ( /y ) and /no ( /n ) options to create batch files and shell scripts that are not interrupted by Advanced Server prompts.

For example, if you use the net logoff command to log off the local area network with connections to remote shared resources intact, Advanced 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 type the following:

net logoff /yes

Using Abbreviations

The command reference pages in this chapter always use the full command names, command options, and service names. However, Advanced Server recognizes abbreviations.

You can abbreviate any command option by typing enough letters to distinguish it from other command options. For example, the following is the syntax for the net accounts command:

net accounts [/forcelogoff:{minutes|no }] [/
minpwlen:length] [/
maxpwage:{days|unlimited}][/minpwage:days] [/uniquepw:number]

You can abbreviate the options as illustrated in the following example:

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

You cannot abbreviate option values (for example, the unlimited option for / maxpwage).

Using Special Characters with Commands

Some of the names or passwords that you need to enter may contain one or more special characters, for example, an ampersand ( & ). When you are at the UNIX system command prompt typing a name with a special character in an Advanced Server command, you must use an escape character (the back slash [ \ ]) before each special character. If you are at a client computer, you can surround the string containing the special characters in double quotes.

For example, to log on with the user name marksp and the password mrkt&dev on the UNIX system command prompt, you could type the following:

net logon marksp mrkt\&dev

Some commonly used UNIX system special characters include the following: asterisk ( * ); semi-colon ( ; ); pipe ( | ); square brackets ( [ ] ); parentheses [ ( ) ]; question mark ( ? ); ampersand ( & ); caret ( ^ ); back slash ( \ ); greater-than and less-than signs ( < > ); blank ( ) and the "at" sign ( @ ).

There are other UNIX special characters that you may encounter. For more information on special characters, consult your UNIX system documentation.

Typing Path Names With UNIX System Net Commands

The UNIX system uses a forward slash to separate names in a path. This is different from client computers, which use back slashes. Always precede path names with c: when using the Net command.

When typing path names at a UNIX system command prompt, you can use any of the following methods:

  • Single forward slashes — separate each element of the path with single forward slashes, like this:

    net share tmpshare=c:/tmp /us:10 /r:"Share for temporary use"
  • Double back slashes — separate each element of the path with double back slashes, like this:

    net share tmpshare=c:\\tmp /us:10 /r:"Share for temporary 
    use"
  • Single quotes — separate each element of the path with single back slashes and surround the whole path in single quotes, like this:

    net share 'tmpshare=c:\tmp' r:"Share for temporary use"

When including spaces in values, you may want to enclose the value in double quotes. For example, to change the comment for the domain guests group, you could type the following command:

net group "domain guests" /comment: "All domain guests"

Typing Path Names at Client Computers

Client computer operating systems, such as Windows 95, Windows NT, and MS- DOS use back slashes to separate names in paths. For example,

net use f:\\product\data

Understanding Command Syntax

The commands that are used in Advanced Server will be easier to understand and use if you keep the following concepts in mind:

  • When an option is enclosed in braces ( { } ), the option is a required item in the syntax statement. For example, {yes | no} indicates that you must specify yes or no when using the command.

  • When an option is enclosed in brackets ( [ ] ), it is an optional item in the syntax statement. For example, [password] indicates that a password may be used with the command, if desired.

  • When a vertical bar ( | ) separates items within braces or brackets, only one of the options must be used. For example, {/hold | /release | /delete} indicates that only one of the three options must be used.

  • When an ellipsis ( ... ) appears in a syntax statement, it indicates that you can repeat the previous item(s). For example, /route: devicename [, ...] indicates that you can specify more than one device, putting a comma between the device names.

  • Be sure to type slashes ( / ), back slashes ( \ ), commas ( , ), double quotes ( " " ), equal signs ( = ), colons ( : ), semicolons ( ; ), and asterisks ( * ) as they are shown.

  • Replace the pound sign ( # ) with a number.

  • At the UNIX system command prompt, you must type Net commands in lower- case letters.

  • When you finish typing a command, press ENTER. If you are typing a long command string, do not press ENTER when your cursor gets to the edge of your screen; the cursor will "wrap around" and continue on the next line of your screen. Press ENTER only after you finish typing the entire command string.

Getting Help on Net Commands

On-line help is available for all of the Net commands that you can enter at the server command prompt. It provides command parameters, syntax, details about a command, and examples of the command in use.

To obtain information about a Net command, type one of the following commands at the Advanced Server system prompt:

Command

Descriptions

net help

Names of available Net commands.

net help command

Description, syntax and options for Net commands.

net command /help

Description, syntax and options for Net commands.

net command /?

Syntax only for Net commands.

net help command /options

Detailed description of the options of the command you selected.

Running net logon before Running net Commands

For most administrative operations, you should perform net logon as an administrator before running the net commands. This is especially important when running the net commands as root. Running net commands as root grants you administrative privileges and bypasses password checks. This allows you to run commands without logging on first. For most net commands, it is not a problem if this is done. Net trust, however, relies on the current user's password when establishing the trust relationship. If you run net trust as root without first logging on, a null password is used, and the trust relationship cannot be authenticated when it is later used.

Advanced Server Net Commands

The Advanced Server net commands described in the following table are supported at the Advanced Server command prompt.

Command

Descriptions

net access

Displays or modifies resource permissions on servers. Use this command only for displaying and modifying permissions on pipes and printer queues. Use net perms for managing permissions on all other types of resources.

net accounts

Displays the role of servers in a domain and displays or modifies password and logon user requirements.

net admin

Runs an Advanced Server command or starts a command processor on a remote server.

net auditing

Displays and modifies the auditing settings of a resource.

net browser

Displays the list of domains that are visible from a local server or the list of computers that are active in a domain.

net computer

Displays or modifies the list of computer accounts in a domain. This command also can be entered as net computers.

net config

Displays the controllable services that are running.

net config server

Displays or changes settings for the Server service while it is running.

net continue

Reactivates suspended services when typed at a server, and reactivates paused shared printers when typed at a client computer.

net device

Displays list of device names and controls shared printers. When used without options, this command displays the status of all shared printers at the specified server. When used with the printer name option, this command displays only the status of the specified printer.

net file

Displays the names of all open shared files and the number of file locks, if any, on each file. This command also can be used to close shared files. When used without options, this command lists all of the open files at a server. This command also can be typed as net files.

net group

Adds, displays, or modifies global groups. This command also can be typed as net groups.

net help

Provides lists of network commands and topics for which you can get help, or provides help for a specific command or topic.

net helpmsg

Provides help for a network error message.

net localgroup

Adds, displays, or modifies local groups in domains. This command also can be typed as net localgroups.

net logoff

Logs a user name off of the network.

net logon

Logs a user name on to the server and sets the user name and password for the user's client. If you do not specify a user name with this command, the default user name will be your UNIX system logon name.

net password

Changes the password for a user account on a server or in a domain.

net pause

Suspends services or printers at a server.

net perms

Displays or modifies resource permissions and ownership information on servers. The resources on which this command currently operates are shares, directories, and files.

net print

Displays or controls print jobs and printer queues; also sets or modifies options for a printer queue.

net send

Sends message to connected client computers.

net session

Lists or disconnects sessions between a server and clients. When used without options, this command displays information about all of the sessions with the local server. This command also can be typed as net sessions.

net 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 server.

net sid

Performs translations between account names and their corresponding security identifiers (SIDs).

net 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, Computer Browser, Directory Replicator, EventLog, Net Logon, Server, Spooler, and Time Source.

net statistics

Displays or clears the statistics log.

net status

Displays a server's computer name, configuration settings, and a list of shared resources.

net stop

Stops a network service.

net time

Synchronizes the client's clock with that of a server or domain, or displays the time for a server or domain.

net trust

Establishes and breaks trust relationships between domains, and lists trust information for a specified domain.

net user

Adds, modifies, or deletes user accounts or displays user account information.

net version

Displays version of network software currently running on the computer at which the command is issued.

net view

Displays list of servers or displays resources being shared by a server

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1997 Hewlett-Packard Development Company, L.P.