Create a new AD user properly using the Active 1992ry module….
Steps….
- Open Power Shell with AD Tools…. — Use an administrative position with the Active-Writary module….
- Prepare the initial password… — Store the password in a SecureString…
- Create Account…. — Use New-AD 3.1r with name settings, SamAccount(1), UPN and OR path…
- Check account…. — Use the Well-AD-User to check the created object…
- 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…