0% found this document useful (0 votes)
3 views

gagandeep assignment 6 final

The document details the process of creating multiple user accounts in Active Directory using a PowerShell script that reads user details from a CSV file. It describes the steps taken to set up the user data, create an Organizational Unit (OU), run the script, and verify the successful creation of users. The author confirms the completion of the assignment by checking the created users in the OU and reviewing the log file for any errors.

Uploaded by

jolalav296
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

gagandeep assignment 6 final

The document details the process of creating multiple user accounts in Active Directory using a PowerShell script that reads user details from a CSV file. It describes the steps taken to set up the user data, create an Organizational Unit (OU), run the script, and verify the successful creation of users. The author confirms the completion of the assignment by checking the created users in the OU and reviewing the log file for any errors.

Uploaded by

jolalav296
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

1

Assignment 6
WINDOW SERVER AND POWERSHELL

GAGANDEEP KAUR
09-04-2025

I used Excel to enter the user details like names, usernames, passwords, and departments. It
was easier to type and organize the data in rows and columns. Then, I saved it as a CSV file
on my Desktop so the script could read it easily.

In the above screenshot, it can be seen that I mentioned that I include all the fields means
first name, last name, username, password, department, and field.
2

The same with the script (making in Notepad). The script which is shown above is used to
automatically create multiple user accounts in Active Directory by reading details from a CSV
file and saving the script as the name of CreateUsers_Gagandeep.ps1. The .ps1 helps to run
the script file easily in PowerShell

The next step is creating an OU and there are two ways one is entering the following
command

New-ADOrganizationalUnit -Name "Students_Gagandeep" -Path "DC=Gagandeep,DC=com"

Or other is by using Physical interface here I am doing by using Physical Interface . Firstly
open the server manager and click on Active directory users and computer
3

Then, I right-click on my domain and select new <OU. I named the OU Students_Gagandeep,
which is shown in the following Screenshot and one thing to notice here there is not users
yet I am going to do that by running the script in powershell
4

I opened the PowerShell and run cd C:\Users\Administrator\Desktop This command helps


me go to the Desktop folder where my script and CSV file were saved (I saved the both files
on the desktop ) and this command is followed by .\CreateUsers_Gagandeep.ps1 by using
this command the Process is started and the script read each row from the CSV file and tried
to create that user in Active Directory.

After running both commands, it was time to check whether it worked or not, and to
confirm that I did it the right way, I ran the following command

Get-ADUser -Filter * -SearchBase "OU=Students_Gagandeep,DC=gagandeep,DC=com" |


Select-Object Name, SamAccountName
5

And by running above command I get the below result which shows I am good going

The next step I checked the log file to know which users were created successfully and if
there were any errors the users who already exists they are skipped

In the Previous screenshot of Students_Gagandeep OU who did not see any users but now
its showing that members or users which I Tried to create means I completed the
assignment .
6

You might also like