A Cool Site for learning different

Thursday, October 04, 2012

Net Command

Net.exe reference.
/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.
This parameter specifies the number of minutes accounts remain locked before automatically becoming unlocked. The range is 1 to 99999.
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.
Minimum number of characters for the password. Default is 6, valid range is between 0 and 14
Maximum number of days a password is valid. Default is 90, valid range is between 0 and 49710
Number of days that must occur before the password can be changed. Default is 0, valid range is between 0 and maxpwage
Password may not be reused for number attempts
Forces a domain sync
Performs any of the above actions on the domain controller
net computer
Used to add and remove computer accounts from the domain.
\\<computer name>
Name of the computer to be added or removed
Add the specified computer
Removes the specified computer
net config server
Allows modifications to the server service. Entered with no parameters give details of the current configuration
Number of minutes an account may be inactive before disconnection. Default is 15, valid range between 1 and 65535. -1 means never disconnected.
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
Number of bytes to be collected before data is sent. The default is 16, valid range is between 0 and 65535.
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.
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.
Identification of the file (given by entering net file on its own)
Close the specified lock
net group
Adds/modifies global groups on servers. Without parameters will list global groups.
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]
Name of the global group
Comment if a new global group is created. Up to 48 characters
Performs the function on the primary domain controller
Username to which apply the operation
Adds the specified user to the group or the group to the domain
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.
The messaging name to be added/removed
Add the name
Remove the name
net pause <service name>
Used to pause a service from the command line.
net print
Used to list/modify print jobs.
Indicates the computer that hosts the printer queue
Name of the printer queue
The job number to modify
Pauses a job on the print queue
Removes the hold status of a job on the print queue
Deletes a job off of the print queue
net send
Sends a message to a computer, user or messaging 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
To all users connected to the server
The message to send

net session
Lists or disconnects sessions. Used with no options lists the current sessions.
\\<computer name>
The computer of whose session to close
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.
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
Name of the share
<device name>
Used to specify the printer name if specifying a printer share
Absolute path
Number of simultaneous connections to the share
Unlimited usage
Comment for the share
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.
\\<computer name>
The name of the computer to which synchronize the time
Synchronize the time with the specified domain
Sets the time
net use
Connects or disconnects to a network share. Used with no qualifiers lists the current network mappings.
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]
<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
Name of the share
Name of the volume if on a NetWare server
Password to which to map
Gives a prompt to which to enter the password
Specifies the user to connect as
Connects to a users home directory
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
net user <username> [password or *] [/add] [options] [/domain]
net user <username] /delete /domain
The name of the account
Assigns or changes a password
Gives a prompt for the password
perform on a domain
Creates the account
Removes the account
/active:[yes or no]
Activates or deactivates the account
Adds a descriptive comment
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
The full name of the account
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
Used to specify the profile path
Path of the logon script
/times:<times or all>
Hours user may logon
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.
\\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