IT Toolbox
Menu
HomeHow to create an Active Directory user with PowerShell
Guide

How to create an Active Directory user with PowerShell

Create a new AD user properly using the Active 1992ry module….

TopicIT resources → About 1 min read

Create a new AD user properly using the Active 1992ry module….

Steps….

  1. Open Power Shell with AD Tools…. — Use an administrative position with the Active-Writary module….
  2. Prepare the initial password… — Store the password in a SecureString…
  3. Create Account…. — Use New-AD 3.1r with name settings, SamAccount(1), UPN and OR path…
  4. Check account…. — Use the Well-AD-User to check the created object…
  5. Assigning the necessary groups… — Add only the groups corresponding to the employee’s role…

Commands

$Password = Read-Host 'Mot de passe initial' -AsSecureString
New-ADUser -Name 'Jean Dupont' -GivenName 'Jean' -Surname 'Dupont' -SamAccountName 'j.dupont' -UserPrincipalName 'j.dupont@exemple.local' -Path 'OU=Utilisateurs,DC=exemple,DC=local' -AccountPassword $Password -Enabled $true -ChangePasswordAtLogon $true
Get-ADUser j.dupont

Key takeaways

  • Always test the path of the,OR before execution….
  • N, grant no administrative privileges by default…
Support the development of BAOI Hosting, domains and new IT resources.
❤️ Support BAOI

My favorites