Generate standardized Active Directory PowerShell scripts from Excel user lists through a local ASP.NET Core Web application.
- Bulk Excel upload for AD user provisioning
- Drag-and-drop Excel support
- Multi-worksheet Excel support
- Automated PowerShell
New-ADUsergeneration - Optional AD group membership generation
- Validation and sanitisation pipeline
- Script preview and downloadable
.ps1output - Local self-hosted Web App deployment
- Single-user quick testing mode
Download the latest Windows release from:
Active Directory user provisioning often involves repetitive, error-prone manual script writing.
This tool automates the transformation of structured staff data (Excel) into validated and standardized PowerShell scripts.
The focus of this project is not only functionality — but also clean architecture and extensibility.
The solution follows a layered design to ensure scalability and reusability:
AdScriptGenerator
│
├── AdScript.Core
│ ├── Models
│ ├── Services
│ ├── Validation
│
├── AdScript.Web
│ ├── Razor Pages
│
└── (Planned)
└── AdScript.Blazor
- Launch the local Web application
- Upload a structured Excel file
- Validate user records
- Preview generated PowerShell commands
- Copy or download the generated
.ps1script - Execute the script in an Active Directory environment
- Download the latest release
- Extract the ZIP file
- Run
AdScript.Web.exe
Current release target: Windows x64.
No .NET installation required.
The application will automatically open in your browser at:
http://localhost:5050
Sample Excel files are included for testing and demonstration purposes:
This tool generates PowerShell scripts only. It does not execute commands or directly connect to Active Directory. Generated scripts should be reviewed by an administrator before running in a production environment.
Responsible for all business logic:
- Excel parsing
- Data sanitisation
- Naming standard enforcement
- Validation rules
- PowerShell script generation
The Core layer has no dependency on ASP.NET, enabling reuse across:
- Web applications
- Desktop applications
- Future Blazor implementation
Handles:
- File upload
- Column mapping
- Script preview
- Script download
The Web layer acts purely as a UI wrapper over the Core logic.
- .NET 8
- ASP.NET Core Razor Pages
- Clean architecture principles
- Excel processing (ClosedXML)
- PowerShell script generation
- Separation of Concerns
- Layered Architecture
- Reusable Core Logic
- Validation Before Execution
- Enterprise Naming Standards
- Future-proof design for UI refactor (Blazor)
- Lowercase
- Special characters removed
- Max 20 characters (legacy NetBIOS constraint)
- Deterministic generation
- Email-style format
- Based on sanitized username
- Configurable domain suffix
- Multi-level dynamic OU construction
- Based on structured organizational data
- Prevent conflicting password flags
- Input sanitation before script generation
- Defensive rule enforcement
Raymond Wang
Master of Information Technology and Systems (MITS) Graduate
Certificate IV in Information Technology
Focus areas:
- C#
- ASP.NET Core
- IT Automation
- Infrastructure Tooling




