Qué vas a conseguir
Una cuenta nueva en Active Directory lista para el primer día: en su unidad organizativa (OU), con los grupos que le dan acceso a carpetas y aplicaciones, y con la contraseña inicial que el usuario cambiará en su primer inicio de sesión.
Antes de empezar
- Una cuenta de administración delegada sobre la OU (no uses tu cuenta de usuario diario).
- El ticket con los datos: nombre, departamento, responsable y a quién tiene que parecerse (el "usuario modelo" del mismo equipo).
- Las herramientas RSAT instaladas: Usuarios y equipos de Active Directory y el módulo de PowerShell.
Si tu empresa tiene un proceso de alta automatizado (RRHH → identidad), esta guía te sirve para entender lo que hace por debajo y para corregir lo que el proceso no cubre.
1. Mira cómo está el usuario modelo
Antes de crear nada, copia la referencia. Así evitas inventarte grupos o OUs.
Get-ADUser modelo.ventas -Properties MemberOf, Department, Title, Manager | Select-Object SamAccountName, DistinguishedName, Department, TitleSamAccountName : modelo.ventasDistinguishedName : CN=Modelo Ventas,OU=Ventas,OU=Usuarios,DC=contoso,DC=localDepartment : VentasTitle : Account Manager(Get-ADUser modelo.ventas -Properties MemberOf).MemberOf | ForEach-Object { ($_ -split ",")[0] -replace "CN=" }GG-VentasGG-Carpeta-Ventas-RWGG-App-CRM-UsuariosGG-VPN-UsuariosApunta la OU (OU=Ventas,OU=Usuarios) y la lista de grupos. Si el modelo tiene un grupo que parece de otra época (una app retirada, un proyecto cerrado), no lo copies: pregúntalo en el ticket.
2. Crea la cuenta
En la consola gráfica: botón derecho sobre la OU → Nuevo → Usuario. Rellena nombre, apellidos, nombre de inicio de sesión y marca El usuario debe cambiar la contraseña en el siguiente inicio de sesión.
Con PowerShell es lo mismo, y queda registrado en el ticket tal cual lo ejecutaste:
$pwd = Read-Host "Contraseña inicial" -AsSecureStringNew-ADUser -Name "Laura Prado" -GivenName Laura -Surname Prado -SamAccountName laura.prado -UserPrincipalName laura.prado@contoso.com -Path "OU=Ventas,OU=Usuarios,DC=contoso,DC=local" -Department Ventas -Title "Account Manager" -AccountPassword $pwd -ChangePasswordAtLogon $true -Enabled $trueGet-ADUser laura.prado | Select-Object Enabled, UserPrincipalName, DistinguishedNameEnabled : TrueUserPrincipalName : laura.prado@contoso.comDistinguishedName : CN=Laura Prado,OU=Ventas,OU=Usuarios,DC=contoso,DC=localEl UserPrincipalName tiene que coincidir con el correo que tendrá el usuario. Si no, el inicio de sesión en Microsoft 365 y en las aplicaciones con SSO fallará aunque la cuenta de AD esté perfecta.
3. Añade los grupos
"GG-Ventas","GG-Carpeta-Ventas-RW","GG-App-CRM-Usuarios","GG-VPN-Usuarios" | ForEach-Object { Add-ADGroupMember -Identity $_ -Members laura.prado }(Get-ADUser laura.prado -Properties MemberOf).MemberOf.Count4Los grupos de seguridad se aplican en el siguiente inicio de sesión del usuario. Si ya había iniciado sesión, tiene que cerrarla y volver a entrar (o ejecutar klist purge y volver a abrir la carpeta).
4. Comprueba
- La cuenta está habilitada y en la OU correcta.
- Los grupos coinciden con el modelo.
- Si hay sincronización con Entra ID (Azure AD Connect), espera al siguiente ciclo (normalmente 30 minutos) o pide que lo fuercen. El usuario aparecerá en Microsoft 365 y entonces se le podrá asignar la licencia.
- Deja en el ticket el nombre de inicio de sesión, la OU y los grupos. La contraseña inicial se entrega por un canal aparte, nunca en el ticket.
Las incidencias que llegarán después
# ¿Cuenta bloqueada por intentos fallidos?Get-ADUser laura.prado -Properties LockedOut, BadLogonCount, LastBadPasswordAttempt | Select-Object LockedOut, BadLogonCount, LastBadPasswordAttemptLockedOut : TrueBadLogonCount : 5LastBadPasswordAttempt : 21/10/2026 9:02:14Unlock-ADAccount -Identity laura.prado# Restablecer la contraseña y forzar el cambioSet-ADAccountPassword -Identity laura.prado -Reset -NewPassword (Read-Host "Nueva" -AsSecureString)Set-ADUser -Identity laura.prado -ChangePasswordAtLogon $trueSi una cuenta se bloquea una y otra vez, el origen suele ser una contraseña antigua guardada en un móvil, una unidad de red mapeada o una tarea programada. El atributo LastBadPasswordAttempt y el visor de eventos del controlador de dominio (evento 4740) te dicen desde qué equipo viene.
Siguientes pasos
- Haz una plantilla de PowerShell por departamento: OU y grupos fijos, y solo cambian nombre y cargo.
- Aprende a leer
Get-ADPrincipalGroupMembershippara auditorías de acceso. - En el Nivel 2 verás cómo Azure AD Connect lleva estas cuentas a Entra ID y qué atributos importan.
¿Falta algo o en tu entorno es distinto? Escríbeme y lo corrijo.
What you'll get
A new Active Directory account ready for day one: in its organisational unit (OU), with the groups that give access to folders and applications, and with an initial password the user will change at first sign-in.
Before you start
- A delegated admin account over the OU (not your everyday user account).
- The ticket with the details: name, department, manager and who to mirror (the "model user" from the same team).
- The RSAT tools installed: Active Directory Users and Computers and the PowerShell module.
If your company has an automated joiner process (HR → identity), this guide helps you understand what it does underneath and fix what the process doesn't cover.
1. Look at the model user
Before creating anything, copy the reference. That way you don't invent groups or OUs.
Get-ADUser model.sales -Properties MemberOf, Department, Title, Manager | Select-Object SamAccountName, DistinguishedName, Department, TitleSamAccountName : model.salesDistinguishedName : CN=Model Sales,OU=Sales,OU=Users,DC=contoso,DC=localDepartment : SalesTitle : Account Manager(Get-ADUser model.sales -Properties MemberOf).MemberOf | ForEach-Object { ($_ -split ",")[0] -replace "CN=" }GG-SalesGG-Folder-Sales-RWGG-App-CRM-UsersGG-VPN-UsersNote the OU (OU=Sales,OU=Users) and the group list. If the model has a group that looks like a leftover (a retired app, a closed project), don't copy it: ask in the ticket.
2. Create the account
In the GUI: right-click the OU → New → User. Fill in first name, last name and logon name, and tick User must change password at next logon.
PowerShell does the same, and it goes into the ticket exactly as you ran it:
$pwd = Read-Host "Initial password" -AsSecureStringNew-ADUser -Name "Laura Prado" -GivenName Laura -Surname Prado -SamAccountName laura.prado -UserPrincipalName laura.prado@contoso.com -Path "OU=Sales,OU=Users,DC=contoso,DC=local" -Department Sales -Title "Account Manager" -AccountPassword $pwd -ChangePasswordAtLogon $true -Enabled $trueGet-ADUser laura.prado | Select-Object Enabled, UserPrincipalName, DistinguishedNameEnabled : TrueUserPrincipalName : laura.prado@contoso.comDistinguishedName : CN=Laura Prado,OU=Sales,OU=Users,DC=contoso,DC=localThe UserPrincipalName has to match the email address the user will have. Otherwise sign-in to Microsoft 365 and to SSO applications fails even though the AD account is perfect.
3. Add the groups
"GG-Sales","GG-Folder-Sales-RW","GG-App-CRM-Users","GG-VPN-Users" | ForEach-Object { Add-ADGroupMember -Identity $_ -Members laura.prado }(Get-ADUser laura.prado -Properties MemberOf).MemberOf.Count4Security groups apply at the user's next sign-in. If they were already signed in, they need to sign out and back in (or run klist purge and reopen the folder).
4. Check
- The account is enabled and in the right OU.
- The groups match the model.
- If there is synchronisation with Entra ID (Azure AD Connect), wait for the next cycle (usually 30 minutes) or ask for it to be forced. The user then appears in Microsoft 365 and can get a licence.
- Leave the logon name, OU and groups in the ticket. The initial password goes through a separate channel, never in the ticket.
The tickets that come later
# Locked out after failed attempts?Get-ADUser laura.prado -Properties LockedOut, BadLogonCount, LastBadPasswordAttempt | Select-Object LockedOut, BadLogonCount, LastBadPasswordAttemptLockedOut : TrueBadLogonCount : 5LastBadPasswordAttempt : 21/10/2026 9:02:14Unlock-ADAccount -Identity laura.prado# Reset the password and force a changeSet-ADAccountPassword -Identity laura.prado -Reset -NewPassword (Read-Host "New" -AsSecureString)Set-ADUser -Identity laura.prado -ChangePasswordAtLogon $trueIf an account locks again and again, the cause is usually an old password saved on a phone, a mapped network drive or a scheduled task. The LastBadPasswordAttempt attribute and the domain controller's event log (event 4740) tell you which device it comes from.
Next steps
- Make a PowerShell template per department: fixed OU and groups, only name and title change.
- Learn to read
Get-ADPrincipalGroupMembershipfor access audits. - In Level 2 you'll see how Azure AD Connect takes these accounts to Entra ID and which attributes matter.
Is something missing, or different in your environment? Get in touch and I'll fix it.
Tech Career Lab · newsletter
¿Te ha servido? Cada dos semanas envío una idea práctica para perfiles IT: LinkedIn, proyectos, networking y procesos de selección.Found this useful? Every two weeks I send one practical idea for IT professionals: LinkedIn, projects, networking and hiring processes.
Apúntate y llévate las 33 ideasSign up and get the 33 ideas →