User info command windows

Net user command : Manage user accounts from command line

Using Net user command, administrators can manage user accounts from windows command prompt. Below are some examples on how to use this command.

Add a domain user account:

Add new user on local computer:

Advanced options to add new user account can be read in the below article.
Add new user from windows command line.

Disable/Lock a domain user account:

To enable/unlock a domain user account:

Prevent users from changing their account password:

To allow users to change their password:

To retrieve the settings of a user:

thaaaaaaaaanx man for the precious information

One Extra Feature that might be very useful.. is to set the Password to Never Expires:

I am using the /EXPIRES:NEVER switch on the end of the command, however the Never Expires checkbow is not ticked when i check the properties

Please notice that the /expires – switch prevents the the account from expiring, but not to the password.

That’s correct. Thanks Ray for clarifying it here for the benefit of others.

Use This Command To Set “Password Never Expire”

WMIC USERACCOUNT WHERE “Name=’username_here’” SET PasswordExpires=FALSE

Is there a way to change the net user username?

My question is how to create multiple users on a network through a command in command prompt using only single command line.

with a loop for.
FOR/L %variable IN (start, step, end) DO command [Settings]

for /L %U in (10,1,20) do net user user-%U Password /add /dom
(to create 10 users named user-10, user-11 to user-20)

check FOR /F [“options”] %%parameter IN (“Text string to process”) DO command
it’s works but not secure

Very good post on windows command line. Thanks for sharing.

Your command for “Add a domain user account” is incorrect, the proper one is:
Net user domainuser domainpassword /add /domain

Gives result:
“The request will be processed at a domain controller for domain softros.local.
The command completed successfully.”

hi how can i create multiple users from cmd
but just with one command??

i know for creating a new user i can use this:
net user username password /add
and to make him an administrator i can use this:
net user username password administrator /add

correct me if i’m wrong and help me please.

Your query, [hi how can i create multiple users from cmd
but just with one command??] – did you ever get an answer to that question ?
Please let me know.

i am currently locked out of my local administrator account on my windows server 2008 r2

i am able to change user accounts and passwords how ever it still telling me that my username or password is incorrect.

i have created a new user account and password but even the new user account and password doesnt work.

Is there a way to put a number of hours logon to the guest account?

interesting stuff here .. Thanks …

hi every body…
please help me how to add users with environment variable(starting program)?

How can I know who changed password for a user on windows server 2008 R2 from CMD and OS?

How can I check from our Internal domain and not our normal /domain?

Thanks so much! However is there a line to reset a password?

Hi I have forgotten my password to get onto the two accounts set up. When I go into net user neither accounts are showing. I get a message saying
The command completed with one or more errors
Can anyone help

Читайте также:  Как узнать свой сетевой интерфейс linux

hello guys in my college when i type the command “net users” it shows two accounts one is “guest” and another is “administrator” but in the login screen there are two accounts one is “guest” and another is “ADMIN” .why this ‘ADMIN’ account is not showing in the cmd.

Is there a command line command to add a group or user name under the security tab option Group or user names: for a domain user?

How to check a user which was created in a different trusted domain. Not to the machine joined.

How can we check for an account creation or disablement date in cmd

How can we run a command to replace the email address in AD from powershell

I need your assistance with batch command tomake this change in my secpol.msc!

i need to set the “password policy” > Password must meet complexity….. to be DISABLED or ENABLED

Just be aware that unlocking/enabling a user account also sets it so that the password must be changed on next logon.

I limit login time with “net user time” command of our son account on W10, but when time expire … he is logout from his User account and login under Admin account WITHOUT been asked for Admin´s password!

Any idea why? Thank you.

Please help me can you find the password for profile, when you are on it.

The article seems to think these are the same things.
They are NOT:

Enabled/disable an account.
Lock/unlock an account.

why does the last logon line read “never”? i have this with my current user which i am trying to time restrict. it wont restrict because it claims to have never logged in.

How can I pull the information of a user who is the different domain in Active Directory like IN or BR or AR?

Hello,
Great read! I am hoping u can help me. I am trying to set time limits for a user. However it completed successfully and still allows user to logon when he is not supposed too! Any advice.

what command i can use get net user status in a single query ?i looking for the format
example
account status
admin enabled

Управление учетными записями Windows через командную строку CMD

Для просмотра и управления учетными записями через командную строку используется команда NET USER.
Если ввести команду net user без параметров, то она покажет список пользователей Windows. Для просмотра справки по команде необходимо указать параметр net user /?

Список основных команд для работы с учетными записями через командную строку:

Добавить пользователя net user /add имя_пользователя пароль
Включить учетную запись пользователя net user /active:yes имя_пользователя
Отключить учетную запись пользователя net user /active:no имя_пользователя
Удалить пользователя net user /delete имя_пользователя

Для добавления пользователя в группу в командной строке используется команда управления локальными группами net localgroup

Добавить пользователя в группу net localgroup имя_группы имя_пользователя /add
Удалить пользователя из группы net localgroup имя_группы имя_пользователя /delete

Например, необходимо создать учетную запись пользователя «Root» с правами администратора и паролем 12345.
Создаем учетную запись: net user /add root 12345
Добавляем созданного пользователя в группу администраторов: net localgroup Администраторы root

Get current logged in user name command line (CMD)

In Windows OS, we can find the current logged in username from windows command line. The logged in user information is stored in environment variables. So just by printing the value in these environment variables we can get to know the login name.

To know the login name of the currently logged in user we can run the below command.

This works on all releases of Windows OS(Windows XP, Server 2003, Windows Vista and Windows 7).

There is another command whoami which tells us the domain name also.

Читайте также:  Трансляция окон мира windows

Both of these options to find user name can be useful in batch files to write code in such a way that it works for every user. For example, if your batch file need to access a user specific folder, say Application data, then you can refer the directory as ‘C:\users\%username%\appdata‘.

how to know the current user password in windows 7?

run cmd in admin mode and type net user (user name) (12345)
then your password change to 12345

Use this command:
net user “%username%” “%random%%random%%random%%random%%random%”

Suggestion to use command:
net user “%username%” “%random%%random%%random%%random%%random%”
will change your current users password to something completely random

I don’t think it would be possible to find the password as it is stored in encrypted form and not in plain text. However, there are lots of third party tools to reset a administrator password if you have forgotten the same.

when i go onto command promt it says my username is “user” and say c:/users>user

I HAVE THE SAME PROBLEM. HAVE YOU SOLVE YOUR PROBLEM YET?

The whoami command does not work in Windows XP without the SP2 Support Tools download. The command is not native to the OS. http://www.microsoft.com/en-us/download/details.aspx?id=18546

Can the %username% command be used to determine the user logged into a differnent computer. ex I am at computer x and want to know who is logged on to computer y. I can remote to the c drive using RDP \\computery\c$ I would also like to definively likt to know who is logged on to that computer. Possible?

No, it does not work that way. %username% always shows the user of the current login session. When you run it on remote computer, I am not sure what you would get but it won’t tell you who logged on to the machine.

You can use PSEXEC to run a command on another PC. It can be found in the PS Tools package available for download on many sites.

With System Internal tools (free http://technet.microsoft.com/en-us/sysinternals/bb897545.aspx )
psloggedon \\targetComputer
or
psloggedon \\192.167.0.0

Is it possible to get current User Name when it’s an AD where each user has an ID?
For example, if I run whoami or %username% I get “XX00000” but I want to get “Name SecondName”. I know windows has this info because I see my full name in Start Menu (Win 7).
Thanks

net user %username% for accounts stored in local or net user %username% /domain for accounts stored on domain.

you know this answer…?… anyone please let me know solution for georges’ question.. thanks in advance..

I would also really like a solution for this

If you are asking to find the full name or Surname run this as administrator.
net user
It will show you all the information about that user, full name, logon time, the group this user belongs to, the time it is allowed to login all of that.

When I run whoami from the cmdline I get my username. However I want to find my username from within SQL Server. If I shell out and run whoami I get the sql service user . Any ideas?

what username lets you look at the history

what does it mean by username

Please show screen shot

I have 2 accounts one for me and one for my nephews and nieces so I forgot my password because it makes me change it every other month it seems like and idk why… but I looked up a way to change it by going into the command prompts but it’s only giving me the kids for net user it says mine doesn’t exist I could use some help asap

I need to find my administrator account password when its logged in so is there way i can do it from cmd to find my password without changing it ?

Читайте также:  Aptana studio windows mac linux

does we have a vraiable like %username% for user group name ?

Описание команды NET USER

Команда NET USER предназначена для добавления, редактирования или просмотра учетных записей пользователей на компьютерах. При выполнении команды в командной строке без параметров отображается список учетных записей пользователей Windows, присутствующих на компьютере (эта команда также хорошо работает и в Windows 10). Информация об учетных записях пользователей хранится в базе данных Windows.

Синтаксис команды NET USER

net user [имя_пользователя [пароль | *] [параметры]] [/domain]

net user имя_пользователя <пароль | *>/add [параметры] [/domain]

net user имя_пользователя [/delete] [/domain], где

  • имя_пользователя — Указывает имя учётной записи пользователя, которую можно добавить, удалить, отредактировать или просмотреть. Имя может иметь длину до 20 символов.
  • пароль — Присваивает или изменяет пароль пользователя. Введите звездочку (*) для вывода приглашения на ввод пароля. При вводе с клавиатуры символы пароля не выводятся на экран.
  • /domain — Выполняет операцию на контроллере основного для данного компьютера домена.
  • параметры — Задает параметр командной строки для команды.
  • net help команда — Отображение справки для указанной команды net.
  • /delete — Удаление учетной записи пользователя.

Дополнительные параметы команды NET USER

  • /active: Активирует или деактивирует учетную запись. Если учетная запись не активирована, пользователь не может получить доступ к серверу. По умолчанию учетная запись активирована.
  • /comment:»текст» — Позволяет добавить описание учетной записи пользователя (максимум 48 символов). Текст описания заключается в кавычки.
  • /countrycode: nnn — Использует код страны, указанный для операционной системы, для реализации соответствующих языковых файлов при отображении пользовательской справки и сообщений об ошибках. Значение 0 соответствует коду страны, используемому по умолчанию.
  • /expires: <дата | never>— Дата истечения срока действия учетной записи. Значение never соответствует неограниченному сроку действия. Дата указывается в формате мм/дд/гг или дд/мм/гг в зависимости от кода страны. Месяц может указываться цифрами, полностью или в сокращенном виде (тремя буквами). Год может указываться двумя ли четырьмя цифрами. Элементы даты разделяются слэшем (/) без пробелов.
  • /fullname:» имя » — Полное имя пользователя (в отличии от имени учетной записи пользователя). Имя указывается в кавычках.
  • /homedir: путь — Указывает путь к домашнему каталогу пользователя. Указанное место должно существовать.
  • /passwordchg: Указывает, может ли пользователь изменять свой пароль (по умолчанию может).
  • /passwordreq: Указывает, должна ли учетная запись пользователя иметь пароль (по умолчанию должна).
  • /profilepath[:путь] — Указывает путь к профилю входа в систему пользователя.
  • /scriptpath: путь — Путь к сценарию, используемому пользователем для входа в систему.
  • /times: <время | all>— Время для входа в систему. Параметр время указывается в формате день[-день][,день[-день]],час [-час][,час [-час]], причем приращение равняется 1 часу. Название дней недели могут указываться полностью или в сокращенном виде. Часы могут указываться в 12- или 24-часовом представлении. Для 12-часового представления используются обозначения am, pm, a.m. или p.m. Значение all соответствует отсутствию ограничений на время входа в систему, а пустое значение обозначает полный запрет на вход в систему. Значения дней недели и времени разделяются запятой; несколько записей для значений дней недели и времени разделяются точкой с запятой.
  • /usercomment:»текст» — Позволяет администратору добавить или изменить комментарий к учетной записи.
  • /workstations: <имя_компьютера[. ] | *>— Позволяет указать до 8 компьютеров, с которых пользователь может войти в сеть. Если для параметра/workstations не указан список компьютеров или указано значение *, пользователь может войти в сеть с любого компьютера.

Примеры команды NET USER

  • Для вывода списка всех пользователей данного компьютера служит команда: net user;
  • Для вывода информации о пользователе «petr» служит следующая команда: net user petr;
  • Для добавления учетной записи пользователя Petr с полным именем пользователя и правом на подключение с 8 до 17 часов с понедельника по пятницу используется следующая команда: net user petr /add /times:Пн-Пт,08:00-17:00/fullname:»Petr».
  • Для удаления учетной записи необходимо ввести команду: net user petr /delete;
  • Для отключения учетной записи необходимо ввести команду: net user petr /active:no.

Видео — Работа с утилитой NET USER

Оцените статью