Batch Script - NET USER



This command can be used for the following −

  • View the details of a particular user account.
  • Add a user account.
  • Delete a user’s account.
  • Modify a user’s account.

Syntax

Net user [username [password | *] [options]] [/DOMAIN] 
username {password | *} /ADD [options] [/DOMAIN] 
username [/DELETE] [/DOMAIN]

Example

NET USER

The above command shows all the accounts defined on a system. Following is the output of the above command.

User accounts for \\WIN-50GP30FGO75
-------------------------------------------------------------------------------
Administrator     atlbitbucket      Guest
The command completed successfully.

net user Guest

The above command shows the details of Guest account defined on a system. Following is the output of the above command.

Output

User name                  Guest
Full Name
Comment                    Built-in account for guest access to the computer/domain
User's comment
Country/region code        000 (System Default)
Account active             No
Account expires            Never

Password last set          1/4/2016 9:34:25 AM
Password expires           Never
Password changeable        1/4/2016 9:34:25 AM
Password required          No
User may change password   No

Workstations allowed       All
Logon script
User profile
Home directory
Last logon                Never

Logon hours allowed       All

Local Group Memberships   *Guests
Global Group memberships  *None
The command completed successfully.
batch_script_network.htm
Advertisements