Skip to content

ConnoisseurOfCookies/-ActiveDirectoryBulkAdd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 

Repository files navigation

AD Bulk User Adder

Index

Purpose

The purpose of this script is to add bulk users to Windows Active Directory by using either a CSV or a JSON file

Instructions

Follow the format as presented in the JSON sample file, it is quite self-explanatory. You will be prompted whether or not you want to create a default password for all users or whether you want to type them in individually. I have removed the option to read unique passwords from plaintext in a file since it is awful OPSEC. If you want to do that, for lab-purposes as an example, then you can look up versions of the script older than 11/1/2023.

Make sure that the organization structure, OU's and groups, have been defined and created prior to running the script The script now scrapes the file for OU's and Groups and checks them against groups that already exist. If the user is a part of a group that doesn't exist the script prompts whether or not to create a new OU.

  1. Modify the addAdUsers.json folder

  2. Edit the relevant details. Note the formatting for the "OU=ouUnit" and "DC=Domain,DC=DomainSuffix"

  3. And for christ's sake, please change the details if you're using this for a school submission. You don't wanna get pinged for plagiarism

  4. Make sure you haven't changed the filenames

  5. Run the script from the folder with admin/escalated privileges (even if you're logged in as admin)

Just Reference the Script file in the command line

    cd .\Your\Directory
    .\addAdUsers.ps1  

Issues

  • Need to create a basic modification to handle different input formats (csv, xml, sql, mongoDB etc.)
  • Drop the .CSV format, it is an objectively horrible formatting standard
  • No Basic error handling code
  • No Some checking for edge cases
  • No handling of duplicate users
  • OU's and Groups need to be created prior to running the script

Todo

  • Provide handling mechanisms for when OU's don't existDone!
  • Prompt the user on whethere or not they would like for new OU's to be created
  • Improve prompts. Could do with some more work
  • Create utility for Home and Group folder creation with prerequisite permissions
  • Create script that serialises, pulls and backs up AD details and configurations, so it can be rebuilt from scratch
  • Break script into smaller modules, separated by folders and files
  • Push JSON file down into a 'samples' directory
  • Configure a "Configure Password prompt" at the start, prompt for either "Generic for All" password or "On individual basis"

Reference

Initial implementation as per video from Server Academy Youtube Channel

About

A simple script to add new users to Active Directory in bulk

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published