chore: fix GPO baseline

This commit is contained in:
2025-07-31 10:48:25 +10:00
parent 107d774076
commit c68ea2dcd3

View File

@ -93,7 +93,8 @@ $gpos = @(
)
foreach ($gpo in $gpos) {
if (-not (Get-GPO -Name $gpo.Name -ErrorAction SilentlyContinue)) {
$existingGPO = Get-GPO -Name $gpo.Name -ErrorAction SilentlyContinue
if (-not $existingGPO) {
New-GPO -Name $gpo.Name | Out-Null
New-GPLink -Name $gpo.Name -Target $gpo.Target | Out-Null
Write-Host "Created and linked GPO '${gpo.Name}'." -ForegroundColor Cyan
@ -102,6 +103,7 @@ foreach ($gpo in $gpos) {
}
}
# Example: set secure screensaver in Security Baseline GPO
Set-GPRegistryValue -Name "Security Baseline" `
-Key "HKLM\Software\Policies\Microsoft\Windows\Control Panel\Desktop" `