#
User-Creation-Bulk.ps1
NOTE: This script is not even close to ready for prime time.
#
Purpose
Automates the bulk creation of Active Directory user accounts with a graphical user interface (GUI). Collects user information, validates input, generates a random password, creates the AD user, configures mailbox, group memberships, employee ID, and organisational structure. Supports both single and bulk user creation (bulk via button for new hire sheet import).
#
Function
- Loads required modules (Active Directory, Exchange Online Management).
- Presents a Windows Forms GUI for user input (first name, last name, employee ID, manager, mirror user, job title, department).
- Validates all fields before allowing user creation.
- Generates a random password using an external password generator script.
- Creates the AD user with all required attributes and home directory.
- Copies group memberships from a specified mirror user.
- Enables an Exchange Online mailbox for the new user.
- Ensures membership in required base groups and removes from non-standard signature groups.
- Displays the new credentials in a pop-up and copies the password to clipboard.
- Includes buttons to clear fields and to bulk create users from a new hire sheet (Excel import logic placeholder).
#
Usage
./User-Creation-Bulk.ps1
The script is fully interactive and uses a GUI. No command-line parameters are required for standard use.
#
Inputs
- User input via GUI: First Name, Last Name, Employee ID, Manager, Mirror User, Job Title, Department (dropdown)
- Bulk import: Button for new hire sheet (Excel import logic placeholder)
#
Variables
$textBoxFirstName
,$textBoxLastName
, etc.: GUI field objects$password
: Generated password for new user$groupNamesAdd
,$groupNamesRemove
: Groups to add/remove for baseline membership$sharePointFilePath
,$localExcelPath
: Paths for bulk import (future use)
#
Command Line Flags
None for standard use. (Bulk import logic may use file paths in future.)
#
Outputs
- Creates new AD user accounts and home directories
- Copies group memberships from mirror user
- Enables Exchange Online mailbox
- Ensures correct group memberships
- Displays credentials in pop-up and copies password to clipboard
- Logs actions and errors to the console and pop-ups
#
Notes
- Requires the Active Directory and Exchange Online Management modules
- Uses an external password generator script (dot-sourced)
- GUI-based; not suitable for headless environments
- Bulk import from Excel/SharePoint is planned but not yet implemented