PowerShell: new-employee onboarding in one script
A script that creates the user, adds groups and sets up the basics — turning a 30-minute checklist into a few seconds.
Goal
Automate the repetitive steps of onboarding a new user in a lab Active Directory (never on company systems without approval).
Plan
- Read new users from a CSV file (name, department, manager).
- Create the account with a standard naming rule.
- Add department groups and set the home folder.
- Write a log file and a short summary report.
- Use AI (Copilot / ChatGPT) to review the script for errors — and note what it got wrong.
# Example of where this starts
Import-Csv .\new-users.csv | ForEach-Object {
New-ADUser -Name "$($_.First) $($_.Last)" -SamAccountName $_.User -Department $_.Dept -Enabled $true
}