Ir al contenido

Windows User Account Management (net user)

Comprehensive management of local user accounts in Windows using native terminal commands.

0views

The net user command is the primary tool in Windows for local identity administration. This technical guide details its operation, from querying the user tree to the exhaustive control of time restrictions and password policies.


Before making any modifications, it is essential to inspect the current state of the local identity system.

This command shows a quick list of all accounts created and integrated into the computer:

Ventana de terminal
net user

Example console output:

Cuentas de usuario para \\NOMBRE-PC
-------------------------------------------------------------------------------
administrador DefaultAccount Invitado
usuario.demo usuario.ejemplo WDAGUtilityAccount
Se ha completado el comando correctamente.

To perform a deep security audit of a user, execute an individualized query. Windows will display critical details regarding logon policies, group memberships, and expiration:

Ventana de terminal
net user usuario.demo

Key fields returned:

Nombre de usuario usuario.demo
Nombre completo Usuario Demo
Comentario Cuenta de prueba para departamento
Cuenta activa Sí
Cuenta expira Nunca
Contraseña última vez establecida 30/10/2025 10:15:00
Contraseña expira Nunca
Contraseña cambiable 30/10/2025 10:15:00
Contraseña requerida Sí
Usuario puede cambiar contraseña Sí
Estaciones de trabajo permitidas Todas
Horas de inicio de sesión permitidas Todas
Miembro de grupos locales *Usuarios

The creation of identities must be carried out under structured privilege policies and clear nomenclature.

This command initializes the user security object in the SAM database, but blocks user login until the password is defined in a subsequent step:

Ventana de terminal
net user usuario.ejemplo /add

The most common workflow for automated account provisioning:

Ventana de terminal
net user usuario.ejemplo ClaveSegura_2026! /add

It is a good administrative practice to document identity by assigning the full real name and an explanatory internal note:

Ventana de terminal
net user usuario.ejemplo ClaveSegura_2026! /add /fullname:"Usuario Ejemplo" /comment:"Cuenta corporativa temporal de pruebas"

One of the greatest advantages of using net user is the ability to modify advanced properties that are often hidden or difficult to configure in the Windows graphical control panel.

Instead of permanently deleting a user who will be absent, temporarily suspend their account to avoid losing their SID or file permissions:

Ventana de terminal
:: Desactivar la cuenta (Bloqueo inmediato de inicio de sesión)
net user usuario.ejemplo /active:no
:: Reactivar la cuenta
net user usuario.ejemplo /active:yes

Ideal for external consultants, interns, or temporary staff. Once the set date is reached, the system will automatically prevent user access:

Ventana de terminal
:: Formato DD/MM/AAAA según configuración regional de Windows
net user usuario.ejemplo /expires:01/01/2026
:: Configurar para que la cuenta NUNCA expire (Valor predeterminado)
net user usuario.ejemplo /expires:never

Useful in educational environments, public demonstrations, or accounts dedicated to automation (Service Accounts):

Ventana de terminal
:: Prohibir que el usuario altere su clave
net user usuario.ejemplo /passwordchg:no
:: Restablecer permiso de cambio de clave
net user usuario.ejemplo /passwordchg:yes

Defines with pin-point precision the exact days and time slots in which the user is permitted to log in to the machine:

Ventana de terminal
:: Permitir estrictamente de Lunes a Viernes de 8:00 AM a 6:00 PM
net user usuario.demo /times:Lunes-Viernes,08:00-18:00
:: Permitir horario de oficina semanal y sábados por la mañana
net user usuario.ejemplo /times:L-V,08:00-18:00;Sábado,09:00-13:00
:: Bloquear por completo el acceso del usuario en cualquier horario
net user usuario.demo /times:

Avoids exposing the password in plain text on the screen by using asterisks:

Ventana de terminal
net user usuario.demo *
Ventana de terminal
net user usuario.demo NuevaClaveSuperSegura.99

If you have made backups of the corresponding user profiles and wish to permanently delete the account, execute:

Ventana de terminal
net user usuario.ejemplo /delete

  • ✓ Preliminary Audit: Always execute net user [usuario] before changing policies.
  • ✓ Security Hardening: Assign mandatory expiration (/expires) to external users.
  • ✓ Secure Alternative: Prefer /active:no over permanently deleting an account with /delete in uncertain situations.