Net User 命令

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 sytax 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 delet a user account from the user accounts database.

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 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:

  1. Restrict login hours of a particular user
  2. Activate Windows Super Administrator Account

转载于:https://www.cnblogs.com/dennysong/p/5133406.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值