На чтение 7 мин. Просмотров 10.4k. Опубликовано
Многие опытные пользователи и администраторы используют командную строку для выполнения различных действий. Говоря об этом, сегодня мы собираемся объяснить, как работает команда net user и что вы можете делать с ней в Windows 10.
Что такое команда net user и как она работает?
Команда Net user была впервые введена в Windows Vista, и с тех пор она стала частью Windows. Команда позволяет создавать и изменять учетные записи пользователей на вашем ПК. Чтобы использовать эту команду, вам нужно запустить Командную строку от имени администратора. Самый быстрый способ сделать это – нажать Клавиша Windows + X , чтобы открыть меню Win + X, а затем выбрать в меню Командная строка (Администратор) .
Когда вы введете net user в командной строке, вы увидите список доступных учетных записей на вашем ПК.
Конечно, вы можете просматривать подробную информацию о доступных учетных записях пользователей на вашем ПК. Чтобы сделать это, просто введите net user wanted_username и нажмите Enter. С помощью этой команды вы увидите полное имя учетной записи пользователя, а также дополнительную информацию. Вы можете увидеть, защищена ли учетная запись паролем и даже временем, когда пароль был установлен. Кроме того, вы можете видеть, к каким группам принадлежит выбранная учетная запись пользователя.
С помощью этой команды вы также можете установить пароли для учетных записей на вашем ПК. Чтобы сделать это, вам просто нужно ввести net user required_username * . Теперь вам будет предложено ввести желаемый пароль и повторно ввести его, чтобы подтвердить изменение.
Если вы хотите установить пароль учетной записи быстрее, вам просто нужно ввести net user wanted_username yournewpassword
В дополнение к изменению паролей вы также можете легко добавлять новые учетные записи на свой компьютер с помощью команды net user . Для этого вам просто нужно ввести net user name_of_the_new_account/add .
- Читайте также: локальная учетная запись пользователя исчезает после обновления создателей [FIX]
При необходимости вы можете добавить пароль к своей учетной записи при его создании с помощью команды net user name_of_the_new_account mypassword/add . Конечно, вы также можете использовать команду net user new_user_name */add , чтобы создать новую учетную запись пользователя с паролем.
С помощью этой команды вы также можете установить активную или неактивную учетную запись. По сути, если вы установите свою учетную запись в неактивное состояние, другие пользователи не смогут увидеть ее или получить к ней доступ без использования команды net user. Чтобы скрыть аккаунт, вам просто нужно ввести net user account_name/active: no . После этого выбранная учетная запись станет скрытой, и вы не сможете получить к ней доступ.
Конечно, вы всегда можете сделать учетную запись доступной, введя команду net user account_name/active: yes . Сетевой пользователь также позволяет назначать комментарии для учетных записей пользователей. Благодаря этой функции вы можете добавить 48-символьный комментарий к любому аккаунту, чтобы отличать его от других. Если вы системный администратор и управляете несколькими учетными записями, это может быть невероятно полезным. Чтобы добавить комментарий, просто введите имя пользователя/комментария сетевого пользователя: «Комментарий сообщение» .
С помощью этой команды вы также можете установить код страны для любой учетной записи на вашем ПК. Это означает, что вы можете изменить язык справки и сообщений об ошибках в любой учетной записи пользователя. У всех пользователей по умолчанию код 000, но вы можете легко изменить его с помощью этой команды. Чтобы изменить код страны конкретного пользователя, введите имя пользователя/имя пользователя в сети: 123 и нажмите Ввод . Конечно, не забудьте заменить 123 фактическим кодом страны.
Также стоит упомянуть, что с помощью этой команды вы можете установить срок действия любой учетной записи. Базовая структура для этой команды: net user user_name/expires: MM/DD/YYYY , но вы также можете использовать формат DD/MM/YYYY. Стоит отметить, что вы можете использовать три типа значений в течение нескольких месяцев. Вы можете использовать полное название месяца, трехбуквенное сокращение или просто число. Что касается года, вы можете использовать двузначные или четырехзначные значения.
Конечно, вы также можете настроить свой аккаунт так, чтобы он никогда не истекал, используя параметр /expire: never .
Вы также можете установить полное имя для любого пользователя на вашем ПК. Если вы управляете несколькими пользователями, эта команда позволит вам различать их по их реальному имени. Чтобы назначить полное имя пользователю, вы просто необходимо ввести net user имя_пользователя/полное имя: «полное имя пользователя» .
- ЧИТАЙТЕ ТАКЖЕ: сообщение «Вам нужно исправить свою учетную запись Microsoft» в Windows 10 [Исправить]
Поскольку многие пользователи, как правило, используют пароли для защиты своих учетных записей, как системный администратор вы можете разрешить или запретить пользователям изменять пароль своей учетной записи. Благодаря этой функции вы запретите пользователям изменять свой пароль без вашего ведома. Чтобы запретить конкретному пользователю изменять свой пароль, вам нужно использовать команду net user user_name/passwordchg: no .
Если вы хотите, чтобы пользователи могли изменять свой пароль, вам нужно использовать команду net user user_name/passwordchg: yes .
Как мы уже упоминали, использование пароля важно, если вы хотите защитить свою учетную запись, и с помощью команды net user вы можете заставить отдельных пользователей использовать пароль. Сделав это, вы уменьшите вероятность несанкционированного доступа. Чтобы заставить пользователя использовать пароль для своей учетной записи, вам нужно использовать команду net user user_name/passwordreq: yes . Конечно, вы можете использовать команду net user user_name/passwordreq: no , чтобы удалить это требование.
Команда net user также позволяет указать период времени, в течение которого пользователь может использовать свою учетную запись. Эта функция особенно полезна, если вы хотите установить временные ограничения для конкретных пользователей. Чтобы ограничить доступ для конкретного пользователя, вам необходимо указать временные рамки для каждого дня.
Вы можете ввести полное название дня или использовать аббревиатуру. Что касается времени, вы можете использовать 12-часовой или 24-часовой формат. Чтобы установить ограничение по времени для пользователя, необходимо использовать net user имя_пользователя/время: M-F, 08: 00-17: 00 . Конечно, вы можете использовать другой формат, чтобы ваша команда выглядела как net user user_name/time: M-F, 8 AM-5PM .
При необходимости вы также можете установить разные временные рамки для разных дней, используя имя пользователя/время в сети: M, 4 AM – 5:00; T, 1 PM – 3:00; W-F, 8: 00-17: 00 .
Вы можете запретить пользователям постоянно входить в свою учетную запись в определенные дни, просто оставив значение пустым. Если вы хотите снять все временные ограничения для определенной учетной записи, просто введите имя пользователя/времени net user: all . Как видите, это довольно мощная команда, но она работает только с шагом в один час, и это ее самый большой недостаток. Тем не менее, эта команда чрезвычайно полезна, если вы хотите ограничить использование компьютера.
С помощью этой команды вы также можете добавить комментарий пользователя для учетной записи, чтобы отличать его от других. Для этого используйте команду net user user_name/usercomment: «Ваш комментарий» .
Команда net user также позволяет вам установить домашний каталог для вашей учетной записи с помощью параметра /homedir . Вы также можете установить сценарий входа для пользователя, используя параметр /scriptpath . При необходимости вы также можете указать путь к профилю с помощью параметра /profilepath .
Команда Net user довольно мощная и позволяет вам управлять учетными записями пользователей на вашем ПК. Команда относительно проста в использовании, и мы надеемся, что наша статья помогла вам немного лучше ее понять.
In this tutorial, you will learn how to use the net user
command to create, delete and change user accounts in the Windows command prompt (CDM).
We can perform the following tasks using the net user
command:
- View user accounts.
- Add and Remove user accounts.
- Activate and Deactivate user accounts.
- Change the user password.
If you are operating in an Active Directory domain environment, always use the /domain
command switch to execute the net user command on the domain controller rather than on the local computer.
Examples
List users on the local computer:
net user
List users on the domain controller:
net user /domain
This command displays detailed information about the Administrator account:
net user Administrator
Create a user named user1 with a password of strongPassword
:
net user /add user1 "strongPassword"
Delete the user user1 from the computer:
net user /delete user2
This command enables the built-in Administrator account on Windows 10/11:
net user Administrator /active:yes
This command sets (changes) the Administrator account password:
net user Administrator "adminPassWord"
Execute the following command to disable the Administrator account on Windows 10/11:
net user Administrator /active:no
This command forces the user user1 to change the password at the next logon:
net user user1 /logonpasswordchg:yes
Create a user; the user must change the password at the next logon:
net user /add user1 "strongPassword" /logonpasswordchg:yes
Create a new user; the account expires on January 31st:
net user /add user1 "strongPassword" /expires:01/31/2023
Command Options
username | The name of the user to create, delete, view, or modify. |
password | Password for the user. |
* | Use this option to produce a prompt for the password. |
/add | Use this option when you want to create a new user. |
/delete | Use this option to remove a user from the Windows system. |
/active:{yes | no} | Activates or Deactivates a user. The default is yes when creating a new user. |
/expires:{date | never} | Use this option to set the expiration date (mm/dd/yy) for an account. The default is never. |
/fullname:»name» | Full name of the user. |
/passwordchg:{yes | no} | Specifies whether users can change their own password. The default is yes. |
/passwordreq:{yes | no} | No means the user can log in without a password. The default is YES. |
/logonpasswordchg:{yes|no} | Specifies whether the user should change the password at the next logon. The default is NO. |
/homedir:path | The home directory location. |
/comment:»text» | Use this option to add a description to the user’s account. |
You can view the manual page by typing net help user
at the command prompt.
View a User
When you execute the net user
command without any options, it displays a list of user accounts on the computer.
net user
You will see an output similar to the following:
Add the /domain
command switch if you want to list users on the Active Directory Domain controller.
net user /domain
To see detailed information about a particular user, execute the command net user Username
, where the Username
is the name of the user you want to view. For example, you can view the Administrator account by running the following command:
net user Administrator
Create and Delete User Accounts
To create a user account, use the following syntax:
net user /add UserName Password
For example, the following command creates a user named user1 with a password of strongPassword
:
net user /add user1 "strongPassword"
Use an asterisk (*
) in place of the password to produce a prompt, as shown in the following example:
net user /add user1 *
Alternatively, you can also use the /random
option to generate a strong random password, as shown in the following example:
net user /add user1 /random
The randomly generated password will be displayed on the command prompt after you execute the command.
To delete a user, use the following syntax:
net user /delete UserName
The following command deletes the user user1 from the computer:
net user /delete user2
Change Passwords
To change passwords, use the following syntax:
net user UserName New-Password
Use an asterisk (*
) or /random
in place of the password to produce a prompt or generate a random password:
net user UserName *
net user user1 /random
Notes
The net user
command is most of the time used in Windows Server to manage Active Directory users.
Windows 10/11 uses a new Settings pane to manage users, but the net user
command is still useful for some tasks. For example, if you want to activate the built-in Administrator account, it is easy to do that using this command.
While working at the command prompt, run the net help user
command to see all available command options.
In the next tutorial, we are going to learn how to manage Windows groups using the net localgroup CMD command.
The Net User command is a Windows command-line utility that allows you to manage Windows server local user accounts or on a remote computer.
The command Net User
allow you to create, delete, enable, or disable users on the system and set passwords for the net user accounts.
Windows administrators can perform add or modifications in domain user accounts using the net user command-line tool.
You can get net user account information, enable or disable a user account, sets the home directory path, set account expiration, and so on.
In this article, we will discuss how to use the net user command-line tool with examples to get user account information, domain account status, and password expiry date.
Net User Command Syntax
The basic syntax for the net user command is as follows:
net user [<UserName> {<Password> | *} [<Options>]] [/domain] net user [<UserName> {<Password> | *} /add [<Options>] [/domain]] net user [<UserName> [/delete] [/domain]]
Refer to the below most important net user command parameters:
Parameter | Description |
---|---|
Username | Enable or disable the user account |
Password | It specifies the user account name to add, modify, or display user account information |
/domain | Perform the operation on the domain controller |
/active:{no | yes} | Enable or disable user account |
/comment | Provide descriptive comments for the user account |
/expires | Specify the date to expire user account |
net help | Display help for the net user command |
<Options> | Specify command-line options |
Refer to the following table to know more about options used in net user command.
Command-line option syntax | Description |
---|---|
/active:{no | yes} | Use this option to enable or disable a user account. The default value is yes (active). |
/comment:”<Text>” | Use this to provide comments for the user account, max 48 characters, and should be enclosed in quotation marks. |
/countrycode:<NNN> | /countrycode option is used to set the country code for the user account to display help or error messages in their language. The default value is 0, which means the computer’s default country/region code. |
/expires:{{<MM/DD/YYYY> | <DD/MM/YYYY> | <mmm,dd,YYYY>} | never} | Use this option to specify the date for the user account to expire. If the expiration date is not specified, it will assume never expires. |
/fullname:”<Name>” | Specify the user’s full name instead of username. |
/homedir:<Path> | Use this option to set the path for the user’s home directory. |
/passwordchg:{yes | no} | Use this to specify if the user can change their own password. The default value is yes. |
/passwordreq:{yes | no} | It specifies if the user must have a password or not. The default is yes. |
/profilepath:[<Path>] | Use this option to sets a path for the user’s logon profile. This path points to a registry profile. |
/scriptpath:<Path> | Use this to set a path for the user’s logon script. <Path> should be relative. |
/times:{<Day>[<-Day>][,<Day>[-<Day>]],<Time>[-<Time>][,<Time>[-<Time>]][;] | all} | It specifies the times that users are allowed to use the computer. |
/usercomment:”<Text>” | It specifies that an administrator can add or change the “User comment” for the account. |
/workstations:{<ComputerName>[,…] | *} | It lists as many as eight workstations from which a user can log on to the network. |
Net User – List All User Accounts
Use the Net User command and run it on the Windows command prompt without any parameter to list all user accounts on the local user account.
Open a command prompt to run the net user command below
net user
The above Windows net user command returns the list of all user accounts on the local computer.
You can also use the net users command without any parameters on the cmd to retrieve a list of all user accounts on your computer.
Run the command net user on the domain controller to get a list of all users on the domain.
net user
The output of the above command net user gets the domain username accounts.
You can also use the net user command-line tool to get user account information, modify a user account, and check when the password was last set.
Net User Account – Display User Account Information
Run the net user command in the command line to get user account information.
# Get the user account information for Toms user. net user Toms
The above net user command uses the username to retrieve user details and display net user account information below
C:\>net user Toms
User name Toms
Full Name John Paul
Comment Built-in account for administering the computer/domain
User's comment
Country/region code 000 (System Default)
Account active Yes
Account expires Never
Password last set 7/29/2021 6:55:50 PM
Password expires 9/9/2021 6:55:50 PM
Password changeable 7/30/2021 6:55:50 PM
Password required Yes
User may change password Yes
Workstations allowed All
Logon script
User profile
Home directory
Last logon 8/2/2021 11:53:32 AM
Logon hours allowed All
Local Group Memberships *Administrators
Global Group memberships *Domain Admins *Group Policy Creator
*Schema Admins *Domain Users
*Enterprise Admins
The command completed successfully.
C:\>
Cool Tip: How to get-aduser in the active directory using PowerShell!
Net User Add Account
To create a new local user account, use the /Add
parameter and specify the desired username:
# Create a new user account on local computer with login name Teresa net user /Add Teresa
To create a domain user account, add the /domain
parameter and specify the username and password:
# Create a new user account on domain with login name Peter and password Shell@123 net user /Add /domain Peter Shell@123
The above command creates a user account on the domain with a username Peter
and password as Shell@123
as plain text in the command line.
Another option to specify the password is using the * in the command after the username, it will show a prompt to enter the password.
net user /Add /domain Peter *
Net User Delete User Account
To delete a local user account, use the /delete
parameter and specify the username, it will delete the user account. It doesn’t ask for confirmation before deleting a user account.
# Delete the user on the local computer net user /delete Teresa
To delete a domain user account, add the /domain
parameter and specify the username.
# Delete the domain user account net user /delete /domain Peter
Net User Password Change for User Account
If you want to change a user password using the command line, use the net user command-line tool to set the password.
The syntax for the command net user to set a password for a user account is given below:
net user userid password
Let’s consider an example to reset the password for user account GaryW on the local computer, run the below command
net user garyw Test@123
In the above net user command, garyw is a user account id and Test@123 is a password that is used with the command to set the password for the user account on the local computer.
The output of the above command as below
Note: Run Windows command prompt using administrator account privileges else it will display “System error 5 has occurred. Access is denied“
There is an alternative and secure way to change the user password using the net user cmd tool as below
C:\>net user garyw * Type a password for the user: Retype the password to confirm: The command completed successfully.
In the command, use * after the user name and hit enter.
It will prompt you to type the password for the user: and retype the password to confirm.
While typing a password, it won’t display password text on the command line.
Cool Tip: How to get-aduser password expiration date in PowerShell!
Net User /domain – change domain user account password
Using the net user Windows command-line tool, you can set the password for the domain user account.
The syntax for the command net user to set the password for the domain user account is:
net user username /domain
Run the following command to reset the domain user account password
net user garyw * /domain
In the above command, the net user command takes the user id as input, * indicates to prompt for the password. /domain specifies to perform domain account password change operation.
The output of the above net user /domain password change as below
Cool Tip: How to use the Get-AdUser cmdlet to manage Active Directory Use Account!
Net User Disable Account
To disable or lock a domain account using the net user command-line tool, use the /Active:No
and /domain
parameters and specify the username:
# Disable the user account on domain net user garyw /Active:No /domain
The above net user command disables the user account or locks the domain user account specified using the user name and /Active set to No in the net user /domain command.
Run the command net user garyw /domain to check the user’s account status, it displays Account active : No
C:\>net user garyw /domain
User name garyw
Full Name Gary Willy
Comment
User's comment
Country/region code 000 (System Default)
Account active No
Account expires Never
To disable a local user account, use the /Active:No
parameter:
# Disable local user account net user testadmin /Active:No
Cool Tip: How to find a disabled aduser using PowerShell!
Net User to Enable Domain Account
To enable or unlock the domain user account using the net user command, use the /Active:Yes
and /domain
parameters and specify the username:
# Enables domain user account net user garyw /Active:Yes /domain
net user /domain command using /Active
option set to Yes enables user account.
To enable a local user account, use the /Active:Yes
parameter and specify the username:
net user testadmin /Active:Yes
Net User User Password Policy
If you want users to restrict them to change their domain account password or allow domain account user to change their password, use the /Passwordchg:No
parameter and specify the username:
net user garyw /Passwordchg:No
In the above net user command, /Passwordchg:No
prevents the user from changing the password.
To allow users to change the password, use the /Passwordchg:Yes
and specify the username:
net user garyw /Passwordchg:Yes
The above command, /Passwordchg:Yes
allows the user to change their password.
Cool Tip: How to find active directory groups I m in using PowerShell!
Net User to Find User Full Name
You can use the net user command-line tool to find the user’s full name in the domain using the Find /i
parameter and specify the “full name” :
net user garyw /domain | Find /i "full name"
The above command finds the full name of the user in the domain, it uses the username /domain to find the user account in the domain and pipes the result to get the full name.
C:\Windows\system32>net user garyw /domain | Find /i "full name"
Full Name Gary Willy
Set Home Directory Path For User
Use the net user command-line tool to set a home directory path for a new user or existing user using the homedir option as below
Set the home directory path for the new user:
# Set the home directory path for user adams net user adams /domain /add /homedir:C:\users\adams
In the above command, the net user creates a new user with the name adams
in the domain and set up the home directory path for the user to C:\users\adams
You can set up a home directory for the existing user as below
# Set the home directory path for existing user garyw net user garyw /domain /homedir:C:\users\garyw
In the above command, it set up the home directory path for the existing user in the domain using the net user command and homdir option.
Cool Tip: How to unlock the ad account in the active directory using PowerShell!
Set Expiry date for User Account on Local and Domain
The expiration date for the user account has been good practice for organizations to manage security and resource management.
Using the net user command, you can easily set an expiry date for the user account on the local computer or domain user account.
To set up an expiry date for user accounts on the local computer or a Windows 11 user account, use the /expires
parameter and specify the date in MM/DD/YYYY format:
# Set expire date for local user account Net User devadmin /expires:03/05/2023
In the above command, the net user command takes the username as the input parameter and uses /expires option to set up the expiry date for the user account on the local computer.
If you want to set up an expiry date for the user account on the domain controller, run the following command.
# Set expire date for domain user account Net User Toms /domain /expires:09/20/2022
In the above command, the net user takes the user name and uses /domain to set up an expiry date in the domain using /expires option.
Set Login Times for User Account
Using the net user command, you can set log in times for the user account to allow them to be used within specific hours only. Use the /time parameter followed by the allowed login times.
Run the following command to set login times for the user account on the local computer.
# Set login time to allow user login in specific duration Net User Toms /time:M-F,07:00-16:00
In the above command, the net user command takes the user name to set up login time for the account to allow login between 7 am to 4 pm on Monday-Friday only.
For domain user accounts, add the /domain
parameter:
# Set login time to allow user login in specific duration on the domain Net User garyw /time:M-F,07:00-16:00 /domain
Net User Command Examples and FAQ
How to reset the user password using the net user command?
Open the Windows command prompt with Administrator privileges and run the following command to reset the password for a user account.
net user userid newpassword
How to use the net user command?
The net user is a command-line tool to manage user accounts on local and domain controllers. To use the net user command, open the command prompt and type the net user command, it will list all user accounts.
net user
How to check domain user details in cmd?
Use the net user command to view the user account details on the domain. The syntax to check user account information is:
net user userid
How to use the net user command to see when the password expires?
If you run net user userid
on cmd terminal, it retrieves user information that includes the property “Password expires“. Use this property to see the user account password expiry date.
How to use the net user command to check the last login of the user?
To check the last login of the user on the domain using the net user command, run the command prompt and run the below command.
net user Toms /domain | Findstr "Last"
It returns the Last Login date for the user account on the domain.
How to use the net user command to set a password never expires using the command line?
To set the password never expires on the user account using the net user command in the cmd terminal, run the following command.
WMIC useraccount where Name='username' set PasswordExpires=FALSE
For example, to set the administrator password never expires using the net user command,
net user administrator |findstr /C:expires
Returns the output as
Account expires Never
Password expires 2/26/2023 4:10:20 PM
Run the WMIC command to set the PasswordExpires property for the administrator account to false.
WMIC useraccount where Name='administrator' SET PasswordExpires=FALSE
The above command line tool set up the administrator password never set to expire.
Conclusion
I hope the above article on the net user command line tool in the Windows system helps you to understand how to manage net user accounts using the command line.
net user without any option gets all the user accounts on the computer. You can also use the net users command to manage the user accounts on the local and domain controller.
You can find more topics about PowerShell Active Directory commands and PowerShell basics on the ShellGeek home page.
Download Windows Speedup Tool to fix errors and make PC run faster
The Net User is a command-line tool that is available in Windows 11/10/8/7/Vista. This tool can help system administrators to add or modify user accounts or even display user account information.
You can use the net user
command to create and modify user accounts on computers. When you use this command without command-line switches, the user accounts for the computer are listed. The user account information is stored in the user accounts database. This command works only on servers.
To run the net user command tool, using the WinX menu, open a Command Prompt, type net user
, and hit Enter. This will show you the user accounts on the computer. Thus, when you use net user
without parameters, it displays a list of the user accounts on the computer.
The syntax for its usage is:
net user [<UserName> {<Password> | *} [<Options>]] [/domain] net user [<UserName> {<Password> | *} /add [<Options>] [/domain]] net user [<UserName> [/delete] [/domain]]
Using net user
with the appropriate parameters allows you to carry out several functions. You can use the following parameters with the net user command:
- username is the name of the user account you want to add, delete, modify, or view.
- password will assign or change a password for the user’s account.
- * will produce a prompt for the password.
- /domain performs the operation on the primary domain controller of the current domain on computers running Windows NT Workstation which are members of a Windows NT Server domain.
- /add will add a user account to the user accounts database.
- /delete will delete a user account from the user accounts database.
Related: How to use Net Use command in Windows.
Net user Change Password
As an example let us say you want to change the password of a user. To change a user’s password, log on as an administrator, open an elevated command prompt type the following and press Enter:
net user user_name * /domain
You will be asked to type a password for the user. Type the new password and later again retype the password to confirm. The password will now be changed.
You could also use the following command. But in this case, you will not be prompted. The password will be directly changed right away:
net user user_name new_password
Amongst many such things, you can also use net user to:
- Activate Windows Super Administrator Account
- Set Time Limit for User Account.
For a detailed read, visit TechNet.
Anand Khanse is the Admin of TheWindowsClub.com, a 10-year Microsoft MVP (2006-16) & a Windows Insider MVP (2016-2022). Please read the entire post & the comments first, create a System Restore Point before making any changes to your system & be careful about any 3rd-party offers while installing freeware.
-
Home
-
News
- [Full Guide] – How to Use Net User Command on Windows 11/10?
By Daisy | Follow |
Last Updated
The net user command is a command-line utility included with Windows that allows you to manage Windows local user accounts. This post from MiniTool teaches you how to use the net user command. Now, keep on your reading.
What is Net User Command
Net User is a command line tool available in Windows 11/10/8/7/Vista. The net user command is a command-line utility included with Windows that allows you to manage Windows local user accounts.
It allows you to create, delete, enable or disable users on the system and set passwords for network user accounts. Windows administrators can use the net user command-line tool to add or modify user accounts. Besides, you can get network user account information, enable or disable user accounts, set home directory paths, set account expiration times, and more.
Net User Command Syntax
Net user command follows the standard syntax system shown below. You need to launch the Command Prompt tool on your PC and you can start using the net user command.
net user [<UserName> {<Password> | *} [<Options>]] [/domain]
net user [<UserName> {<Password> | *} /add [<Options>] [/domain]]
net user [<UserName> [/delete] [/domain]]
Various functions can be performed using the appropriate parameters of the net user. You can use the following parameters with the net user command:
- <username> – Specify the username to the account you want to perform the action on.
- <password> – Set or change the password for the specified user account. Use * to get a prompt for the password.
- /domain – Used for managing domain accounts.
- /add – Create a new user account.
- /delete – Delete a user account.
- /active – Enable or disable the user account. Options are yes or no.
- /expire – Set the date when the account expires.
- /time – Specifies the times that a user is allowed to log in.
Net User Command Examples
How to use net user command? First, you need to open Command Prompt. To do this, type cmd into the Start menu, then right-click Command Prompt and choose Run as administrator.
Command 1: List All the User Accounts
To list all the user accounts present in your system, type net user and press the Enter Key.
Tips:
Tip: This WDAGUtilityAccount is part of Windows Defender Application Guard, which provides your computer with additional security against malicious attacks while using the Internet.
Command 2: Add a New User Account
To add a new user account in your Windows, you need to type net user /add username and press the Enter key.
To verify whether your new user account is created or not, you can either use the net user command again. Alternatively, you can go to Control Panel > User Accounts > Change Account Type. You can see your newly created user account.
Command 3: Create a Password for the New Account
To assign a password to your new account, type Replace user_name and new_password with the new account name you created previously and the password that you want to create.
Command 4: Enable or Disable User accounts
To enable and disable accounts, simply replace /Active:no with /Active:yes.
Command 5: Delete a Specific User Account
To delete a specific user account, you can use the command net user /delete user_account_name. Replace user_account_name with the name of the user account that you want to delete.
About The Author
Position: Columnist
Having been an editor at MiniTool since graduating college as an English major, Daisy specializes in writing about data backups, disk cloning, and file syncing as well as general computer knowledge and issues. In her free time, Daisy enjoys running and going with friends to the amusement park.