Complete Active Directory teaching environment based on dockurr/windows: - Windows Server domain controller, Windows 11 client, Debian 12 client - docker-compose orchestration, env-driven configuration - Bilingual documentation (FR + EN) for students - Dual approach (GUI + PowerShell) in every procedure - Instructor course plan and reference scripts - RDP launcher scripts for Linux, macOS and Windows Made by AcadéNice - https://acadenice.fr/
3.4 KiB
Group Policy Objects (GPO)
Goal: create and link a few representative GPOs.
What is a GPO
A Group Policy Object is a set of settings applied to users or computers. It
is stored in SYSVOL (on DCs) and replicated to all domain-joined machines.
Two main scopes:
Computer configuration: applied at bootUser configuration: applied at logon
A GPO is linked to a container (site, domain, OU). Objects in that
container and its descendants inherit the GPO. You thus use OUs as scoping
targets: link a GPO to Students OU and it will only apply to those users.
Lab scenarios
Three GPOs:
- Strengthen the domain password policy
- Force a wallpaper on students
- Restrict Control Panel access for students
Password policy
Lives in the Default Domain Policy, applied domain-wide.
GUI
- Open
Group Policy Management(gpmc.msc) - Domain >
Default Domain Policy> right-click >Edit Computer Configuration > Policies > Windows Settings > Security Settings > Account Policies > Password Policy- Tune minimum length, complexity, history, age
PowerShell
Key cmdlet: Set-ADDefaultDomainPasswordPolicy.
Set-ADDefaultDomainPasswordPolicy -Identity corp.lab `
-MinPasswordLength 10 `
-ComplexityEnabled $true `
-PasswordHistoryCount 5 `
-MaxPasswordAge (New-TimeSpan -Days 90) `
-LockoutThreshold 5 `
-LockoutDuration (New-TimeSpan -Minutes 15)
Wallpaper GPO
GUI
gpmc.msc> Domain > right-clickOU=Students,OU=Users,OU=CORP>Create a GPO in this domain, and link it here- Name it (e.g.
GPO_Students_Wallpaper) - Right-click GPO >
Edit User Configuration > Policies > Administrative Templates > Desktop > Desktop- Setting
Desktop Wallpaper>Enabled, set the image path and style
PowerShell
Key cmdlets: New-GPO, New-GPLink, Set-GPRegistryValue.
New-GPO -Name "GPO_Students_Wallpaper"
Set-GPRegistryValue -Name "GPO_Students_Wallpaper" `
-Key "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" `
-ValueName "Wallpaper" -Type String -Value "C:\Windows\Web\Wallpaper\Windows\img0.jpg"
New-GPLink -Name "GPO_Students_Wallpaper" `
-Target "OU=Students,OU=Users,OU=CORP,DC=corp,DC=lab"
Control Panel restriction GPO
Same steps via GUI, setting:
User Configuration > Policies > Administrative Templates > Control Panel > Prohibit access to Control Panel and PC settings > Enabled
PowerShell:
New-GPO -Name "GPO_Students_NoCP"
Set-GPRegistryValue -Name "GPO_Students_NoCP" `
-Key "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" `
-ValueName "NoControlPanel" -Type DWord -Value 1
New-GPLink -Name "GPO_Students_NoCP" `
-Target "OU=Students,OU=Users,OU=CORP,DC=corp,DC=lab"
Test
On a client machine with a student logged in:
gpupdate /force
gpresult /r
gpresult lists effective GPOs. If yours is missing, check:
- the user is in the right OU
- the GPO is linked to the right OU
- the user has
Apply Group Policypermission (security filtering) - no WMI filter blocks it
Notes
- Don't stuff the
Default Domain Policy. Always create dedicated GPOs for anything beyond the password policy. - GPO precedence: Local > Site > Domain > OU (closer wins on conflicts).
Block Inheritancebreaks the chain for a child OU. Use sparingly.
Next
05-shares-ntfs.md for SMB shares and NTFS permissions.