Improve domain enrollment and desktop personalization
This commit is contained in:
@@ -3,7 +3,8 @@ param(
|
||||
[string]$TargetOuDn = 'OU=Usuarios-SGU,DC=lci,DC=lasalle,DC=mx',
|
||||
[string]$GpoName = 'SGU - User session restrictions',
|
||||
[string]$DomainController = $env:COMPUTERNAME,
|
||||
[string]$WallpaperPath
|
||||
[string]$WallpaperPath,
|
||||
[switch]$ClearManagedWallpaper
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
@@ -115,6 +116,17 @@ if ($PSCmdlet.ShouldProcess($GpoName, 'Prevent SGU users from manually locking w
|
||||
-Type String `
|
||||
-Value '10' | Out-Null
|
||||
}
|
||||
elseif ($ClearManagedWallpaper) {
|
||||
foreach ($wallpaperValueName in 'Wallpaper','WallpaperStyle') {
|
||||
Remove-GPRegistryValue `
|
||||
-Name $GpoName `
|
||||
-Domain $domainName `
|
||||
-Server $DomainController `
|
||||
-Key $policyKey `
|
||||
-ValueName $wallpaperValueName `
|
||||
-ErrorAction SilentlyContinue | Out-Null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$configuredValue = Get-GPRegistryValue `
|
||||
@@ -166,4 +178,5 @@ if ($WallpaperPath) {
|
||||
ScreenSaverDisabled = [string]$screenSaverValue.Value -eq '0'
|
||||
DarkMode = ([int]$appsThemeValue.Value -eq 0) -and ([int]$systemThemeValue.Value -eq 0)
|
||||
Wallpaper = $configuredWallpaper
|
||||
DynamicWallpaperAllowed = -not [bool]$configuredWallpaper
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user