Original Author: Mark Rhodes - markrhodes@gmail.com - @mrhodes
This repository contains PowerShell scripts for automating Active Directory tasks including:
- Creating user accounts from CSV
- Creating AD groups from CSV
- Mapping users to groups from CSV
- Setting up a Domain Controller
- Promoting users to Domain Admins
- Windows Server 2016, 2019, or 2022
- Active Directory RSAT tools installed
- User account with sufficient privileges to perform administrative tasks
- PowerShell 5.1 or later
- Extract all files to a directory
- Run the desired PowerShell scripts from an Administrative PowerShell prompt
- Ensure CSV files are properly formatted (see examples in repository)
For a new environment, run scripts in this order:
DCSetup.ps1- Set up the Domain Controller (only on new DC)dumping-ground.ps1- Create OUs (optional)CreateGroups.ps1- Create AD groups from CSVCreateUserAccounts.ps1- Create user accounts from CSVUserstoGroups.ps1- Add users to groups from CSVPromotetoADAdmins.ps1- Promote specific users to Domain Admins
Required columns: Department, Enabled, GivenName, Manager, Name, OfficePhone, SamAccountName, Surname, Title, Password, Email
Required column: Name
Required columns: Group, SamAccountName
- User photos should be placed in the
userimages/folder with filenames matching the user'sNamefield (e.g.,John Smith.jpg) - A default
user.jpgshould be present for users without specific photos - Scripts include progress bars for bulk operations
Pull requests are welcome! Please ensure scripts are tested in a lab environment before submitting.