This PowerShell script creates new Active Directory users from a CSV file.
It first loads the Active Directory module and reads user details from
C:\Users\Administrator\Desktop\AD\Marketing.csv.
For each user, it takes their username, first name, last name, display name, password, and organizational unit (OU).
The password is securely converted, and a new AD user is created with their details.
The account is enabled, and the user will need to change their password on their first login.
After each user is created, a message is displayed to confirm it.
To get this script to work, you need to create an Organizational Unit (OU), which, as you can see, I have already done.
My OU name is Marketing.
In this step, I created a CSV file that contains the username, password, and organizational unit for each user.
This file serves as the input for the PowerShell script, ensuring that all necessary user details are structured correctly.
By including these attributes in the CSV, we can efficiently automate the process of adding users to Active Directory while maintaining consistency and accuracy.
I successfully executed the PowerShell script to import user data from a CSV file into Active Directory.
Summary
This project shows how I used PowerShell and a CSV file to automatically create user accounts in Active Directory.
Instead of adding users one by one, the script reads user details from a CSV file and adds them all at once.
I first created a special folder in Active Directory called an Organizational Unit (OU) named “Marketing”.
Then, I made a CSV file with each user’s name, password, and group information.
The PowerShell script uses that file to create each user, set a password, and require them to change it when they first log in.
If a user in the file is missing a password, the script skips them.
This makes it faster and easier to add many users at the same time.
