Category Archives: Network Management

Pathping

The Pathping command lists information about network latency and network loss at intermediate hops between a source and destination. This is different from the tracert command which only identifies the number of hops/routers between a source and destination. Pathping sends multiple Echo Request messages to each router between a source and destination over a period of time and then computes results based on the packets returned from each router. Because pathping displays the degree of packet loss at any given router or link, you can determine which routers or subnets might be having network problems. Used without parameters, pathping displays help.

Syntax (view syntax formatting guide):

pathping [-n] [-h MaximumHops] [-g HostList] [-p Period] [-q NumQueries[-w Timeout] [-i IPAddress] [-4 IPv4] [-6 IPv6][TargetName]

Syntax Explanation

  • -n: Prevents pathping from attempting to resolve the IP addresses of intermediate routers to their names. This might expedite the display of pathping results.
  • -h MaximumHops: Specifies the maximum number of hops in the path to search for the target (destination). The default is 30 hops.
  • -g HostList: Specifies that the Echo Request messages use the Loose Source Route option in the IP header with the set of intermediate destinations specified in HostList. With loose source routing, successive intermediate destinations can be separated by one or multiple routers. The maximum number of addresses or names in the host list is 9. The HostList is a series of IP addresses (in dotted decimal notation) separated by spaces.
  • -p Period: Specifies the number of milliseconds to wait between consecutive pings. The default is 250 milliseconds (1/4 second).
  • -q NumQueries: Specifies the number of Echo Request messages sent to each router in the path. The default is 100 queries.
  • -w Timeout: Specifies the number of milliseconds to wait for each reply. The default is 3000 milliseconds (3 seconds).
  • -i IPAddress: Specifies the source address.
  • -4 IPv4: Specifies that pathping uses IPv4 only.
  • -6 IPv6: Specifies that pathping uses IPv6 only.
  • TargetName: Specifies the destination, which is identified either by IP address or host name.
  • /?: Displays help at the command prompt.

Pathping parameters are case-sensitive.

To avoid network congestion, pings should be sent at a sufficiently slow pace.

To minimize the effects of burst losses, do not send pings too frequently.

When using the -p parameter, pings are sent individually to each intermediate hop. Because of this, the interval between two pings sent to the same hop is period multiplied by the number of hops.

When using the -w parameter, multiple pings can be sent in parallel. Because of this, the amount of time specified in the Timeout parameter is not bounded by the amount of time specified in the Period parameter for waiting between pings.

This command is available only if the Internet Protocol (TCP/IP) protocol is installed as a component in the properties of a network adapter in Network Connections.

Explanation with Examples

The following example shows pathping command output:

pathping -n corp1

D:>pathping -n corp1

Tracing route to corp1 [10.54.1.196]
over a maximum of 30 hops:
  0  172.16.87.35
  1  172.16.87.218
  2  192.168.52.1
  3  192.168.80.1
  4  10.54.247.14
  5  10.54.1.196

Computing statistics for 125 seconds...
            Source to Here   This Node/Link
Hop  RTT    Lost/Sent = Pct  Lost/Sent = Pct  Address
  0                                           172.16.87.35
                                0/ 100 =  0%   |
  1   41ms     0/ 100 =  0%     0/ 100 =  0%  172.16.87.218
                               13/ 100 = 13%   |
  2   22ms    16/ 100 = 16%     3/ 100 =  3%  192.168.52.1
                                0/ 100 =  0%   |
  3   24ms    13/ 100 = 13%     0/ 100 =  0%  192.168.80.1
                                0/ 100 =  0%   |
  4   21ms    14/ 100 = 14%     1/ 100 =  1%  10.54.247.14
                                0/ 100 =  0%   |
  5   24ms    13/ 100 = 13%     0/ 100 =  0%  10.54.1.196

Trace complete.

When pathping is run, the first results list the path. This is the same path that is shown using the tracert command. Next, a busy message is displayed for approximately 90 seconds (the time varies by hop count). During this time, information is gathered from all routers previously listed and from the links between them. At the end of this period, the test results are displayed.

In the sample report above, the This Node/Link, Lost/Sent = Pct and Address columns show that the link between 172.16.87.218 and 192.168.52.1 is dropping 13 percent of the packets. The routers at hops 2 and 4 also are dropping packets addressed to them, but this loss does not affect their ability to forward traffic that is not addressed to them.

The loss rates displayed for the links, identified as a vertical bar (|) in the Address column, indicate link congestion that is causing the loss of packets that are being forwarded on the path. The loss rates displayed for routers (identified by their IP addresses) indicate that these routers might be overloaded.

 

Ntbackup

The ntbackup command is a built-in backup utility that allows you to backup and restore full, differential and incremental backups of critical system files and data. Ntbackup was introduced in Windows NT in 1997 and is supported on Windows NT, 2000, XP and Windows 2003. Ntbackup is not available in Windows Vista or Windows Server 2008. Instead, you should use the wbadmin command and subcommands to back up and restore your computer and files from a command prompt.

It is important to note that you cannot recover backups that you created with ntbackup by using wbadmin. However, a version of ntbackup is available as a download for Windows Server 2008 and Windows Vista users who want to recover backups that they created using ntbackup. This downloadable version of ntbackup enables you to perform recoveries only of legacy backups, and it cannot be used on computers running Windows Server 2008 or Windows Vista to create new backups. To download this version of ntbackup, see http://go.microsoft.com/fwlink/?LinkId=82917.

 

NSLOOKUP Command Line

The Nslookup command line command allows you to displays information that you can use to diagnose Domain Name System (DNS) infrastructure. One thing you should note, before using this tool, you should be familiar with how DNS works. The Nslookup command prompt tool is available only if you have installed the TCP/IP protocol. Nslookup can be used directly from the command prompt or as a shell. If you run Nslookup with no parameters, it will enter shell mode, where you can type further commands as shown in the following image:

This image shows NSLOOKUP in interactive or shell mode. The shell mode commands are seen with the ? command.

The following syntax rules apply.

Syntax (view syntax formatting guide):

Nslookup [<-SubCommand ...>] [{<ComputerToFind> | -<Server>}]
Nslookup /exit
Nslookup /finger [<UserName>] [{[>] <FileName>|[>>] <FileName>}]
Nslookup /{help | ?}
Nslookup /ls [<Option>] <DNSDomain> [{[>] <FileName>|[>>] <FileName>}]
Nslookup /lserver <DNSDomain>
Nslookup /root
Nslookup /server <DNSDomain>
Nslookup /set <KeyWord>[=<Value>]
Nslookup /set all
Nslookup /set class=<Class>
Nslookup /set [no]d2
Nslookup /set [no]debug
Nslookup /set [no]defname
Nslookup /set domain=<DomainName>
Nslookup /set [no]ignore
Nslookup /set port=<Port>
Nslookup /set querytype=<ResourceRecordType>
Nslookup /set [no]recurse
Nslookup /set retry=<Number>
Nslookup /set root=<RootServer>
Nslookup /set [no]search
Nslookup /set srchlist=<DomainName>[/...]
Nslookup /set timeout=<Number>
Nslookup /set type=<ResourceRecordType>
Nslookup /set [no]vc
Nslookup /view <FileName>

Syntax Explanation

  • Nslookup /exit: Exits nslookup.
  • Nslookup /finger: Connects with the finger server on the current computer.
  • Nslookup /help: Displays a short summary of nslookup subcommands.
  • Nslookup /ls: Lists information for a DNS domain.
  • Nslookup /lserver: Changes the default server to the specified DNS domain.
  • Nslookup /root: Changes the default server to the server for the root of the DNS domain name space.
  • Nslookup /server: Changes the default server to the specified DNS domain.
  • Nslookup /set: Changes configuration settings that affect how lookups function.
  • Nslookup /set all: Prints the current values of the configuration settings.
  • Nslookup /set class: Changes the query class. The class specifies the protocol group of the information.
  • Nslookup /set d2: Turns exhaustive Debugging Mode on or off. All fields of every packet are printed.
  • Nslookup /set debug: Turns Debugging Mode on or off.
  • Nslookup /set defname: Appends the default DNS domain name to a single component lookup request. A single component is a component that contains no periods.
  • Nslookup /set domain: Changes the default DNS domain name to the name specified.
  • Nslookup /set ignore: Ignores packet truncation errors.
  • Nslookup /set port: Changes the default TCP/UDP DNS name server port to the value specified.
  • Nslookup /set querytype: Changes the resource record type for the query.
  • Nslookup /set recurse: Tells the DNS name server to query other servers if it does not have the information.
  • Nslookup /set retry: Sets the number of retries.
  • Nslookup /set root: Changes the name of the root server used for queries.
  • Nslookup /set search: Appends the DNS domain names in the DNS domain search list to the request until an answer is received. This applies when the set and the lookup request contain at least one period, but do not end with a trailing period.
  • Nslookup /set srchlist: Changes the default DNS domain name and search list.
  • Nslookup /set timeout: Changes the initial number of seconds to wait for a reply to a request.
  • Nslookup /set type: Changes the resource record type for the query.
  • Nslookup /set vc: Specifies to use or not use a virtual circuit when sending requests to the server.
  • Nslookup /view: Sorts and lists the output of the previous ls subcommand or commands.

Explanation with Examples

If ComputerToFind is an IP address and the query is for an A or PTR resource record type, the name of the computer is returned. If ComputerToFind is a name and does not have a trailing period, the default DNS domain name is appended to the name. This behavior depends on the state of the following set subcommands: domain, srchlist, defname, and search.

 

If you type a hyphen (-) instead of ComputerToFind, the command prompt changes to nslookup interactive mode.

 

The command-line length must be less than 256 characters.

Nslookup has two modes: interactive and noninteractive. 
If you need to look up only a single piece of data, use noninteractive mode. For the first parameter, type the name or IP address of the computer that you want to look up. For the second parameter, type the name or IP address of a DNS name server. If you omit the second argument, nslookup uses the default DNS name server.
If you need to look up more than one piece of data, you can use interactive mode. Type a hyphen (-) for the first parameter and the name or IP address of a DNS name server for the second parameter. Or, omit both parameters and nslookup uses the default DNS name server. Following are some tips about working in interactive mode:

To interrupt interactive commands at any time, press CTRL+B.

To exit, type exit.

To treat a built-in command as a computer name, precede it with the escape character ().

An unrecognized command is interpreted as a computer name.

 

Examples

Each command-line option consists of a hyphen (-) followed immediately by the command name and, in some cases, an equal sign (=) and then a value.

To change the default query type to host (computer) information and the initial time-out to 10 seconds:

nslookup -querytype=hinfo -timeout=10

 

 

Nfsstat

The nfsstat command allow you to display the number of NFS calls made to the Server. When used with the –z option, the nfsstat command resets the number of NFS calls made to the Server to 0.

Syntax (view syntax formatting guide):

nfsstat [-z]

Syntax Explanation

  • Without [-z]: Displays the number of NFS V2, NFS V3, and Mount V3 calls made to the server since the counters were set to 0
  • [-z]: Resets the number of Mount V3 calls to 0

Explanation with Examples

To reset all call-related information to zero on the client and server, enter:

nfsstat –z

 

Nfsshare

The nfsshare command allow you to control Network File System (NFS) share. When you run the nfsshare command without arguments, the nfsshare command-line utility lists all Network File System (NFS) shares exported by Server for NFS. With ShareName as the only argument, nfsshare lists the properties of the NFS share identified by ShareName. When ShareName and Drive:Path are provided, nfsshare exports the folder identified by Drive:Path as ShareName. When the /delete option is used, the specified folder is no longer made available to NFS clients.

Syntax (view syntax formatting guide):

nfsshare <ShareName>=<Drive:Path> [-o <Option=value>...]
nfsshare {<ShareName> | <Drive>:<Path> | * } /delete

Syntax Explanation

The nfsshare command accepts the following options and arguments:

  • -o anon={yes | no}: Specifies whether anonymous (unmapped) users can access the shared directory. The default is no.
  • -o rw[=Host[:Host]…]: Provides read-write access to the shared directory by the hosts or client groups specified by Host. Separate host and group names with a colon (:). If Host is not specified, all hosts and client groups (except those specified with the ro option) have read-write access. If neither the ro nor the rw option is set, all clients have read-write access to the shared directory.
  • -o ro[=Host[:Host]…]: Provides read-only access to the shared directory by the hosts or client groups specified by Host. Separate host and group names with a colon (:). If Host is not specified, all clients (except those specified with the rw option) have read-only access. If the ro option is set for one or more clients, but the rw option is not set, only the clients specified with the ro option have access to the shared directory.
  • -o encoding={big5|euc-jp|euc-kr|euc-tw|gb2312-80|ksc5601|shift-jis}: Specifies the default encoding used for file and directory names and, if used, must be set to one of the following: big5 (Chinese);euc-jp (Japanese); euc-kr (Korean); euc-tw (Chinese); gb2312-80 (Simplified Chinese); ksc5601 (Korean); shift-jis (Japanese). If this is option is not set, the default encoding scheme is ANSI or, on systems configured for non-English locales, the default encoding scheme for the locale. The following are the default encoding schemes for the indicated locales: SHIFT-JIS (Japanese); KS_C_5601-1987 (Korean); GB2312-80 (Simplified Chinese); BIG5 (Traditional Chinese)
  • -o anongid=gid: Specifies that anonymous (unmapped) users will access the share directory using gid as their group identifier (GID). The default is -2. The anonymous GID will be used when reporting the owner of a file owned by an unmapped user, even if anonymous access is disabled.
  • -o anonuid=uid: Specifies that anonymous (unmapped) users will access the share directory using uid as their user identifier (UID). The default is -2. The anonymous UID will be used when reporting the owner of a file owned by an unmapped user, even if anonymous access is disabled.
  • -o root[=Host[:Host]…]: Provides root access to the shared directory by the hosts or client groups specified by Host. Separate host and group names with a colon (:). If Host is not specified, all clients have root access. If the root option is not set, no clients have root access to the shared directory.
  • /delete: If ShareName or Drive:Path is specified, deletes the specified share. If * is specified, deletes all NFS shares.

Explanation with Examples

Still to come!

Nfsadmin

The nfsdmain command allows you to manage Clients and Server for NFS. The nfsadmin command and be utilitized on local or remote computers running the Microsoft Services for Network File System (NFS). If you are logged on with an account that does not have the required privileges, you can specify a user name and password of an account that does in order to perform the nfsadmin command. The action performed by nfsadmin depends on the command arguments you supply.

Syntax (view syntax formatting guide):

nfsadmin server [ComputerName] [-u UserName[-p Password]] –l
nfsadmin server [ComputerName] [-u UserName [-p Password]] -r {client | all}
nfsadmin server [ComputerName] [-u UserName [-p Password]] {start | stop}
nfsadmin server [ComputerName] [-u UserName [-p Password]] config Option[...]
nfsadmin server [ComputerName] [-u UserName [-p Password]] creategroup Name
nfsadmin server [ComputerName] [-u UserName [-p Password]] listgroups
nfsadmin server [ComputerName] [-u UserName [-p Password]] deletegroup Name
nfsadmin server [ComputerName] [-u UserName [-p Password]] renamegroup OldName NewName
nfsadmin server [ComputerName] [-u UserName [-p Password]] addmembers Name Host[...]
nfsadmin server [ComputerName] [-u UserName [-p Password]] listmembers
nfsadmin server [ComputerName] [-u UserName [-p Password]] deletemembers Group Host[...]
nfsadmin client [ComputerName] [-u UserName [-p Password]] {start | stop}
nfsadmin client [ComputerName] [-u UserName [-p Password]] config Option[...]

Syntax Explanation

In addition to service-specific command arguments and options, nfsadmin accepts the following:

  • ComputerName: Specifies the remote computer you want to administer. You can specify the computer using a Windows Internet Name Service (WINS) name or a Domain Name System (DNS) name, or by Internet Protocol (IP) address.
  • -u UserName: Specifies the user name of the user whose credentials are to be used. It might be necessary to add the domain name to the user name in the form domainUserName
  • -p Password: Specifies the password of the user specified using the -u option. If you specify the -u option but omit the -p option, you are prompted for the user’s password.

Administering Server for NFS

Use the nfsadmin server command to administer Server for NFS. The specific action that nfsadmin server takes depends on the command option or argument you specify:

  • -l: Lists all locks held by clients.
  • -r {client | all}: Releases the locks held by a client or, if all is specified, by all clients.
  • start: Starts the Server for NFS service.
  • stop: Stops the Server for NFS service.
  • config: Specifies general settings for Server for NFS. You must supply at least one of the following options with the config command argument:
  • mapsvr=server: Sets server as the User Name Mapping server for Server for NFS. Although this option continues to be supported for compatibility with previous versions, you should use the sfuadmin utility instead.
  • auditlocation={eventlog | file | both | none}: Specifies whether events will be audited and where the events will be recorded. One of the following arguments is required.
  • eventlog: Specifies that audited events will be recorded only in the Event Viewer application log.
  • file: Specifies that audited events will be recorded only in the file specified by config fname.
  • both: Specifies that audited events will be recorded in the Event Viewer application log as well as the file specified by config fname.
  • none: Specifies that events will not be audited.
  • fname=file: Sets the file specified by file as the audit file. The default is %sfudir%lognfssvr.log
  • fsize==size: Sets size as the maximum size in megabytes of the audit file. The default maximum size is 7 MB.
  • audit=[+|-]mount [+|-]read [+|-]write [+|-]create [+|-]delete [+|-]locking [+|-]all: Specifies the events to be logged. To start logging an event, type a plus sign (+) before the event name; to stop logging an event, type a minus sign () before the event name. If the sign is omitted, the plus sign is assumed. Do not use all with any other event name.
  • lockperiod=seconds: Specifies the number of seconds that Server for NFS will wait to reclaim locks after a connection to Server for NFS has been lost and then reestablished or after the Server for NFS service has been restarted.
  • Portmapprotocol={TCP | UDP | TCP+UDP: Specifies which transport protocols Portmap supports. The default setting is TCP+UDP.
  • mountprotocol={TCP | UDP | TCP+UDP}: Specifies which transport protocols mount supports. The default setting is TCP+UDP.
  • nfsprotocol={TCP | UDP | TCP+UDP}: Specifies which transport protocols Network File System (NFS) supports. The default setting is TCP+UDP
  • nlmprotocol={TCP | UDP | TCP+UDP}: Specifies which transport protocols Network Lock Manager (NLM) supports. The default setting is TCP+UDP.
  • nsmprotocol={TCP | UDP | TCP+UDP}: Specifies which transport protocols Network Status Manager (NSM) supports. The default setting is TCP+UDP.
  • enableV3={yes | no}:Specifies whether NFS version 3 protocols will be supported. The default setting is yes.
  • renewauth={yes | no}: Specifies whether client connections will be required to be reauthenticated after the period specified by config renewauthinterval. The default setting is no.
  • renewauthinterval=seconds: Specifies the number of seconds that elapse before a client is forced to be reauthenticated if config renewauth is set to yes. The default value is 600 seconds.
  • dircache=size: Specifies the size in kilobytes of the directory cache. The number specified as size must be a multiple of 4 between 4 and 128. The default directory-cache size is 128 KB.
  • translationfile=[file]: Specifies a file containing mapping information for replacing characters in the names of files when moving them from Windows-based to UNIX-based file systems. If file is not specified, then file name character translation is disabled. If the value of translationfile is changed, you must restart the server for the change to take effect.
  • dotfileshidden={yes | no}: Specifies whether files that are created with names beginning with a period (.) will be marked as hidden in the Windows file system and consequently hidden from NFS clients. The default setting is no.
  • casesensitivelookups={yes | no}: Specifies whether directory lookups will be case sensitive (requiring exact matching of character case). You also need to disable Windows kernel case-insensitivity in order for Server for NFS to support case-sensitive file names. You can disable Windows kernel case-insensitivity by clearing the following registry key to 0: HKLMSYSTEMCurrentControlSetControlSession Managerkernel DWORD “obcaseinsensitive”
  • ntfscase={lower | upper | preserve}: Specifies whether the case of characters in the names of files in the NTFS file system will be returned in lowercase, uppercase, or in the form stored in the directory. The default setting is preserve. This setting cannot be changed if casesensitivelookups is set to yes.
  • creategroup name: Creates a new client group, giving it the specified name.
  • listgroups: Displays the names of all client groups.
  • deletegroup name:Removes the client group specified by name.
  • renamegroup OldName NewName: Changes the name of the client group specified by OldName to NewName
  • addmembers Name Host[…]: Adds Host to the client group specified by Name.
  • listmembers Name: Lists the host computers in the client group specified by Name.
  • deletemembers Group Host[…]: Removes the client specified by Host from the client group specified by Group.

NOTE: If you do not specify a command option or argument, nfsadmin server displays the current Server for NFS configuration settings.

Administering Client for NFS

Use the nfsadmin client command to administer Client for NFS. The specific action that nfsadmin client takes depends on the command argument you specify:

  • start: Starts the Client for NFS service.
  • Stop: Stops the Client for NFS service.
  • Config:Specifies general settings for Client for NFS. You must supply at least one of the following options with the config command argument:
  • fileaccess=mode: Specifies the default permission mode for files created on Network File System (NFS) servers. The mode argument consists of a three digits from 0 to 7 (inclusive) representing the default permissions granted the user, group, and others (respectively). The digits translate to UNIX-style permissions as follows: 0=none, 1=x, 2=w, 3=wx, 4=r, 5=rx, 6=rw, and 7=rwx. For example, fileaccess=750 gives rwx permission to the owner, rx permission to the group, and no access permission to others.
  • mapsvr=server: Sets server as the User Name Mapping server for Client for NFS. Although this option continues to be supported for compatibility with previous versions, you should use the sfuadmin utility instead.
  • mtype={hard | soft}: Specifies the default mount type. For a hard mount, Client for NFS continues to retry a failed RPC until it succeeds. For a soft mount, Client for NFS returns failure to the calling application after retrying the call the number of times specified by the retry option.
  • retry=number: Specifies the number of times to try to make a connection for a soft mount. This value must be from 1 to 10, inclusive. The default is 1.
  • timeout=seconds: Specifies the number of seconds to wait for a connection (remote procedure call). This value must be 0.8, 0.9, or an integer from 1 to 60, inclusive. The default is 0.8.
  • Protocol={TCP | UDP | TCP+UDP}: Specifies which transport protocols the client supports. The default setting is TCP+UDP
  • rsize=size: Specifies the size, in kilobytes, of the read buffer. This value can be 0.5, 1, 2, 4, 8, 16, or 32. The default is 32.
  • wsize=size: Specifies the size, in kilobytes, of the write buffer. This value can be 0.5, 1, 2, 4, 8, 16, or 32. The default is 32.
  • perf=default: Restores the following performance settings to default values: mtype, retry,timeout,rsize and wsize
  • fileaccess=mode: Specifies the default permission mode for files created on Network File System (NFS) servers. The mode argument consists of a three digits from 0 to 7 (inclusive) representing the default permissions granted the user, group, and others (respectively). The digits translate to UNIX-style permissions as follows: 0=none, 1=x, 2=w, 3=wx, 4=r, 5=rx, 6=rw, and 7=rwx. For example, fileaccess=750 gives rwx permission to the owner, rx permission to the group, and no access permission to others.

NOTE: If you do not specify a command option or argument, nfsadmin client displays the current Client for NFS configuration settings.

 

Net Use

The Net use command allows you to connect of disconnect a computer from a shared resource as well as display detailed information about computer connections. The Net use command is also a good way to control all persistent net connections on a specified computer or resource. If you use the net use command without any specific parameters you will get a list of all the network connections on a specific computer.

Syntax (view syntax formatting guide):

net use [{<DeviceName> | *}] [\<ComputerName><ShareName>[<volume>]] [{<Password> | *}]] [/user:[<DomainName>]<UserName] >[/user:[<DottedDomainName>]<UserName>] [/user: [<UserName@DottedDomainName>] [/savecred] [/smartcard] [{/delete | /persistent:{yes | no}}]
net use [<DeviceName> [/home[{<Password> | *}] [/delete:{yes | no}]]
net use [/persistent:{yes | no}]

Syntax Explanation

  • DeviceName: Assigns a name to connect to the resource or specifies the device to be disconnected. There are two kinds of device names: disk drives (that is, D: through Z:) and printers (that is, LPT1: through LPT3:). Type an asterisk (*) instead of a specific device name to assign the next available device name.
  • \ComputerNameShareName: Specifies the name of the server and the shared resource. If ComputerName contains spaces, use quotation marks around the entire computer name from the double backslash (\) to the end of the computer name (for example, “\Computer NameShare Name“). The computer name can be from 1 to 15 characters long.
  • volume: Specifies a NetWare volume on the server. You must have Client Service for NetWare or Gateway Service for Netware (Windows Server) installed and running to connect to NetWare servers.
  • Password: Specifies the password needed to access the shared resource. Type an asterisk (*) to produce a prompt for the password. The password is not displayed when you type it at the password prompt.
  • /user: Specifies a different user name with which the connection is made.
  • DomainName: Specifies another domain. If you omit DomainName, net use uses the current logged on domain.
  • UserName: Specifies the user name with which to log on.
  • DottedDomainName: Specifies the fully-qualified domain name for the domain where the user account exists.
  • /savecred: Stores the provided credentials for reuse.
  • /smartcard: Specifies the network connection is to use the credentials on a smart card. If multiple smart cards are available, you are asked to specify the credential.
  • /delete: Cancels the specified network connection. If you specify the connection with an asterisk (*), all network connections are canceled.
  • /persistent: {yes | no}: Controls the use of persistent network connections. The default is the setting used last. Deviceless connections are not persistent. Yes saves all connections as they are made, and restores them at next logon. No does not save the connection being made or subsequent connections. Existing connections are restored at the next logon. Use /delete to remove persistent connections.
  • /home: Connects a user to the home directory.
  • net help <Command>: Displays help for the specified net command.

Explanation with Examples

Connecting and disconnecting from a network resource

  • Use net use to connect to and disconnect from a network resource, and to view your current connections to network resources. You cannot disconnect from a shared directory if you use it as your current drive or an active process is using it.

Viewing connection information; To view information about a connection, you can do either of the following:

  • Type net use DeviceName to get information about a specific connection.
  • Type net use to get a list of all the computer’s connections.

Using deviceless connections

  • Deviceless connections are not persistent.

Connecting to NetWare servers

  • After you install and run Client Service for NetWare, you can connect to a NetWare server on a Novell network. Use the same syntax that you use to connect to a Windows Networking server, except you must include the volume you to which you want to connect.

Using quotation marks

  • If the ServerName that you supply contains spaces, use quotation marks around the text (that is, “Server Name“). If you omit quotation marks, an error message appears.z

To assign the disk-drive device name E: to the Letters shared directory on the \Financial server:

net use e: \financialletters

To assign (map) the disk-drive device name M: to the directory Mike within the Letters volume on the \Financial server:

net use m: \financiallettersmike

To connect the user identifier Dan as if the connection were made from the Accounts domain:

net use d:\servershare /user:AccountsDan

To disconnect from the \FinancialPublic directory, type:

net use f: \financialpublic /delete

To connect to the resource memos shared on the \Financial 2 server:

net use k: “\financial 2” memos

To restore the current connections at each logon, regardless of future changes, type:

net use /persistent:yes

 

Net Print

The Net Print command displays and controls information about specified printer ques and jobs. Note the Net Print command has been depreciated in Windows 7 and Server 2008. However, you can perform many of the same tasks included in the Net Print command through Prnj0bs.vbs, Windows Management Instrumentation (WMI), or through the use of the new Windows PowerShell cmdlets.

Syntax (view syntax formatting guide):

Net print {\<ComputerName><ShareName> |
\<ComputerName> <JobNumber> [/hold | /release | /delete]} [help]

Syntax Explanation

  • \ComputerNameShareName: Specifies (by name) the computer and print queue about which you want to display information.
  • \ComputerName: Specifies (by name) the computer that hosts the print job you want to control. If you do not specify a computer, the local computer is assumed. Requires the JobNumber parameter.
  • JobNumber: Specifies the number of the print job you want to control. This number is assigned by the computer that hosts the print queue where the print job is sent. After a computer assigns a number to a print job, that number is not assigned to any other print jobs in any queue hosted by that computer. Required when using the \ComputerName parameter.
  • [/hold | /release | /delete]: Specifies the action to take with the print job. The /hold parameter delays the job, allowing other print jobs to bypass it until it is released. The /release parameter releases a print job that has been delayed. The /delete parameter removes a print job from a print queue. If you specify a job number, but do not specify any action, information about the print job is displayed.
  • help: Displays help for the Net print command.

Explanation with Examples

This example shows how to list the contents of the Dotmatrix print queue on the \Production computer:

Net print \ProductionDotmatrix

This example shows how to display information about job number 35 on the \Production computer:

Net print \Production 35

This example shows how to delay job number 263 on the \Production computer:

Net Print \Production263 /hold

This example shows how to release job number 263 on the \Production computer:

Net print \Production 263 /release

 

Net Localgroup

The Net Localgroup command allows you to add, display and modify local groups. When utilized with the /domain attribute the net localgroup command will add the specified group to the domain. Otherwise, the operation is performed on the local machine.

Syntax (view syntax formatting guide):

net localgroup [GroupName [/comment:"Text"]] [/domain]
net localgroup [GroupName {/add [/comment:"Text"] | /delete} [/domain]
net localgroup [GroupName Name […] {/add |  /delete} [/domain]

Syntax Explanation

  • GroupName: Specifies the name of the local group to add, expand, or delete. Used without additional parameters, net localgroup GroupName displays a list of users or global groups in a local group.
  • /comment:”Text Adds a comment for a new or existing group. The comment can contain up to 256 characters. Enclose the text in quotation marks.
  • /domain: Performs the operation on the primary domain controller of the current domain. Otherwise, the operation is performed on the local computer.
  • Name[ …]: Lists one or more user names or group names to add or remove from a local group.
  • /add: Adds a global group name or user name to a local group. You must first establish an account for users or global groups before you can add it to a local group with this command.
  • /delete: Removes a group name or user name from a local group.
  • net help Command: Displays help for the specified net command.

Explanation with Examples

  • Using /domain: /domain applies only to computers that are members of a domain. By default, server computers perform operations on the primary domain controller.
  • Using Name: Separate multiple entries with a space. Names can be local users, users on other domains, or global groups, but not other local groups. If a user is from another domain, preface the user name with the domain name (for example, SalesRalphr).
  • Grouping users: Use net localgroup to group users who use the computer or network in the same or similar ways. When you assign rights to a local group, each member of the local group automatically has the same rights.

The following example displays a list of all the local groups on the local server:

net localgroup

The following example adds a local group called Exec to the local user accounts database:

net localgroup exec /add

The following example adds a local group called Exec to the domain user accounts database:

net localgroup exec /add /domain

The following example adds the existing user accounts stevev, ralphr (from the Sales domain), and jennyt to the Exec local group on the local computer:

net localgroup exec stevev salesralphr jennyt /add

The following example adds the existing user accounts stevev, ralphr, and jennyt to the Exec group of a domain:

net localgroup exec stevev ralphr jennyt /add /domain

The following example displays users in the Exec local group:

net localgroup exec

The following example adds a comment to the Exec local group record:

net localgroup exec /comment:”The executive staff.”