How yann-mickael/active-directory-sous-powershell works
Project Type & Purpose
This is a PowerShell–based automation toolkit whose purpose is to configure a Windows Server 2012 R2 as an Active Directory Domain Controller, deploy required services (AD DS, DNS, RSAT), create a new AD forest (laplateforme.io), and import users/groups from a CSV file into an OU. It’s essentially an infrastructure‐as‐code script suite rather than a multi‐tier application.
Main Components
• Administrator & Script Runner
– The administrator workstation or CI/CD host from which the .ps1 scripts are invoked.
• Input Data
– Utilisateurs.csv (semicolon-delimited list of user attributes and group names).
• PowerShell Scripts (.ps1 files)
– Renommer le server.ps1 (rename & reboot)
– Configuration réseau.ps1 (static IP, DNS, interface rename, firewall rule)
– Installation des rôles.ps1 (install AD-DS, DNS, RSAT modules)
– (Embedded in scripts) ADDSDeployment module use & Install-ADDSForest (forest creation)
– Création Utilisateurs-Groupes.ps1 (create OU “Personnel”, groups, users, add members)
• Target Server Infrastructure
– Windows Server 2012 R2 VM (Domain Controller)
– Services: Active Directory Domain Services, DNS Server, RSAT-AD-PowerShell
– NTDS database & SYSVOL paths on C:\Windows
• Organizational Structures in AD
– Forest: Laplateforme.io
– Domain NetBIOS: LAPLATEFORME
– OU “Personnel” containing groups and users
• Network Layer
– LAN interface with static IP (192.168.1.5/24), gateway (192.168.1.254), loopback DNS
– ICMPv4 firewall rule for client-domain join
• Client Integration
– Windows 10 VM(s) configured to join the domain via DNS resolution of the DC
Relationships & Data Flow
– Administrator invokes scripts → scripts read Utilisateurs.csv → configure network → install roles → call Install-ADDSForest → server becomes DC + DNS authoritative for laplateforme.io → scripts parse CSV → create groups then users in OU=Personnel → Add-ADGroupMember calls populate group memberships.
– Clients query DNS on the DC → join domain → authenticate against AD DS → users log in using newly created accounts.
Architectural Patterns & Principles
• Modular, sequential pipeline: each .ps1 handles a discrete step, idempotent checks (Get-ADGroup/Get-ADUser) avoid duplicates.
• Declarative configuration: scripts define desired state (IP config, features, AD structure).
• Data‐driven provisioning: external CSV drives user/group creation, making it extensible.
• Use of built-in Windows features & modules (ADDSDeployment, RSAT-AD-PowerShell).