Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 



Net.exe reference.

RSS
Subscribe to Windows IT Pro | See More Systems Administration Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

A. Below is a summary of all the net.exe usage methods.

net accounts

Used to modify user accounts. Specified on its own will give information about the current logon.

Options:

/forcelogoff:<minutes or no> Minutes until the user gets logged off after logon hours expire. No means a forced logoff will not occur
/lockoutthreshold:<number of failed attempts> This parameter allows you to configure the number of failed logon attempts before the account is locked. The range is 1 to 999.
/lockoutduration:<minutes>  This parameter specifies the number of minutes accounts remain locked before automatically becoming unlocked. The range is 1 to 99999.
/lockoutwindow:<minutes>   This parameter lets you configure the maximum number of minutes between two consecutive failed logon attempts before an account is locked. The range is 1 to 99999.
/minpwlen:<length> Minimum number of characters for the password. Default is 6, valid range is between 0 and 14
/maxpwage:<days> Maximum number of days a password is valid. Default is 90, valid range is between 0 and 49710
/minpwage:<days> Number of days that must occur before the password can be changed. Default is 0, valid range is between 0 and maxpwage
/uniquepw:<number> Password may not be reused for number attempts
/sync Forces a domain sync
/domain Performs any of the above actions on the domain controller

net computer

Used to add and remove computer accounts from the domain.

Options:

\\<computer name> Name of the computer to be added or removed
/add Add the specified computer
/del Removes the specified computer

net config server

Allows modifications to the server service. Entered with no parameters give details of the current configuration

Options:

/autodisconnect:<minutes> Number of minutes an account may be inactive before disconnection. Default is 15, valid range between 1 and 65535. -1 means never disconnected.
/srvcomment:"text" Set the comment for the machine
/hidden:<yes or no> Specified is the computer is hidden in the listing of computers

net config workstation

Allows modifications to the workstation service. Entered with no parameters give details of the current configuration

Options:

/charcount:<bytes> Number of bytes to be collected before data is sent. The default is 16, valid range is between 0 and 65535.
/chartime:<msec> Number of milliseconds NT waits before sending data. If charcount is also set whichever is satisfied first is used. Default is 250, valid range is between 0 and 65535000.
/charwait:<seconds> Number of seconds NT waits for a communications device to become available. Default is 3600, valid is between 0 and 65535.

net continue <service name>

Restarts the specified paused service.

net file

Lists any files that are open/locked via a network share.

Options:

id Identification of the file (given by entering net file on its own)
/close Close the specified lock

See Q. How can I tell who has which files open on a machine? for more details.

net group

Adds/modifies global groups on servers. Without parameters will list global groups.

Syntax:

net group <group name> [/command:"<text>"] [/domain]
net group <group name> [/add [/comment:"<text>"] or /delete] [/domain]
net group <group name> <user name> /add or /delete [/domain]

Options:

groupname Name of the global group
/comment:"<text>" Comment if a new global group is created. Up to 48 characters
/domain Performs the function on the primary domain controller
username Username to which apply the operation
/add Adds the specified user to the group or the group to the domain
/delete Removes a group from a domain or a user from a group

net localgroup

Performs actions on local groups. Same parameters as net group.

net name

Adds/removes a name to which messaging may be directed to. Running the command on its own will list all messaging names eligible on the machine.

Options:

name The messaging name to be added/removed
/add Add the name
/delete Remove the name

net pause <service name>

Used to pause a service from the command line.

net print

Used to list/modify print jobs.

Options:

\\computername Indicates the computer that hosts the printer queue
sharename Name of the printer queue
job The job number to modify
/hold Pauses a job on the print queue
/release Removes the hold status of a job on the print queue
/delete Deletes a job off of the print queue

net send

Sends a message to a computer, user or messaging name.

Options:

name Name of the user, computer or messaging name. Can also use * to send to everyone in the group
/domain:<domain name> All users in the current domain or the specified domain
/users To all users connected to the server
message The message to send

net session

Lists or disconnects sessions. Used with no options lists the current sessions.

Options:

\\<computer name> The computer of whose session to close
/delete Closes the session to the computer specified. Omitting a computer name will close all sessions

net share

Used to manage shares from the command line.

Syntax:

net share <sharename>=<drive>:\<directory> [/users=<number> or /unlimited] [/remark:"text"]
net share <sharename> [/users=<number> or /unlimited] [/remark:"text"]
net share <sharename or device name or drive and path> /delete

Options:

<sharename> Name of the share
<device name> Used to specify the printer name if specifying a printer share
<drive>:<path> Absolute path
/users:<number> Number of simultaneous connections to the share
/unlimited Unlimited usage
/remark:"<text>" Comment for the share
/delete Delete the specifed share

net start <service name>

Start the specified service

net statistics [workstation or service]

Gives information about either the server or workstation service.

net stop <service name>

Stops the specified service

net time

Used to synchronize the time of a computer.

Options:

\\<computer name> The name of the computer to which synchronize the time
/domain:<domain> Synchronize the time with the specified domain
/set Sets the time

net use

Connects or disconnects to a network share. Used with no qualifiers lists the current network mappings.

Syntax:

net use <device name> or * \\<computer name>\<share name> [password or *] [/user:[domain\user] /delete or [persistent:[yes or no]]
net use <device name> /home /delete or /persistent:[yes or no]

Options:

<device name> Name of the device to map to. Use * to use the next available device name
\\computer name The name of the computer controlling the resource
\sharename Name of the share
\volume Name of the volume if on a NetWare server
password Password to which to map
* Gives a prompt to which to enter the password
/user:<domain>\<user> Specifies the user to connect as
/home Connects to a users home directory
/delete Closes a connection
/persistent:[yes or no> Sets if the connection should be reconnected at next logon

net user

Used to add/create/modify user accounts

Syntax:

net user <username> [password or *] [/add] [options] [/domain]
net user <username] /delete /domain

username The name of the account
password Assigns or changes a password
* Gives a prompt for the password
/domain perform on a domain
/add Creates the account
/delete Removes the account
/active:[yes or no] Activates or deactivates the account
/comment:"<text>" Adds a descriptive comment
/counterycode.nnn nnn is the number operating system code. Use 0 for the operating systems default
/expires:<date or never> The expiry date of the account. Date format is mm,dd,yy or dd,mm,yy which is determined by the country code
/fullname:"<name>" The full name of the account
/homedir:<path> Path for the users home directory
/passwordchg:[yes or no] Used to specify if the user can modify the password
/passwordreq:[yes or no] Used to determine if the account needs a password
/profilepath:<path> Used to specify the profile path
/scriptpath:<path> Path of the logon script
/times:<times or all> Hours user may logon
/usercomment:"<text>" A comment for the account
/workstations:<machine names> Names the user may logon to. * means all.

net view

Lists shared resources on a domain. Used with no parameters lists all machine accounts in a domain.

Options:

\\computer name Specifies the computer whose resource should be viewed
/domain:<domain name> The domain to be used
/network:<NetWare network> A NetWare network to be used

End of Article



Reader Comments
I like to add several users using the NET.exe command.
If I use:
C:\>NET USER test password /ADD /EXPIRES:NEVER

the user 'test' should be created with never expiring password 'password'.

But if I check this user with the user manager, the 'Password never expires' checkbox is still unchecked.

How can I be sure that the password never expires?

Kind regards,
Wim.

Van Balen Wim March 12, 2001


Same problem as Van!

Michael March 03, 2004


I have an a lan with win2002 server and Netware Novell 4.2 Server. I want to redirect a LPT1 port to a lan queue on Ms-DOS programs but when delete the redirection the program not response, i need to send the print job's to 3 diferent queues using the NET.exe command to assign the printer queue to a print port.

how can i do?

Ricardo Ramos March 31, 2004


Whenever I log off (or shut down or restart) I get the message "net.exe failed to initialize (0x0000142)."

Should I do something to correct this?

Paul Pinkston June 03, 2004


Password never expire: The /expires parameter in net user talks about when the ACCOUNT expires, not the password. If your local or group policy has max password age = 0, the account should never expire


Anonymous User October 14, 2004


When I shut down I get the message "net.exe failed to initalize (0x0000142)" Kow do I correct this

papajohn November 20, 2004 (Article Rating: )


When I shut down I get the message "net.exe failed to initalize (0x0000142)" Kow do I correct this

papajohn November 20, 2004 (Article Rating: )


I am writing a program to spawn net.exe to change user passwords. Does net.exe have return values and what are they? Also, is it even possible to spawn when net.exe is already in memory? Thanks.

Rob


Anonymous User April 20, 2005 (Article Rating: )


i have 3 computers, and use msdos program on computer no. 2. on no.2 is the printer (usb).
why is it so long time to print out?when i push print, it takes about 1 min. before it begins to print out.
on my old machine it printet right away

Anonymous User May 17, 2005 (Article Rating: )


papajohn

maybe your net.exe is corrupt

Anonymous User May 17, 2005 (Article Rating: )


 See More Comments  1   2 

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 9, 2009

An often irreverent look at some of the week's other news, including some more Windows 7 sales momentum, some Sophos stupidity, Microsoft's cloud computing self-loathing, more whining from the browser makers, Zoho's "Fake Office," and much, much more ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...

Windows 7 Sets Sales Record

Microsoft CEO Steve Ballmer described Windows 7's first ten days of sales as "fantastic" while in Japan yesterday. ...


Related Events WinConnections and Microsoft® Exchange Connections

Deep Dive into Windows Server 2008 R2 presented by John Savill

Configuration Manager SP1 and R2 Overview

Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement