Apply lock screen through PersonalizationCSP
This commit is contained in:
@@ -79,6 +79,8 @@ $eventForwardingPolicyKey = 'HKLM\Software\Policies\Microsoft\Windows\EventLog\E
|
||||
$auditPolicyKey = 'HKLM\System\CurrentControlSet\Control\Lsa'
|
||||
$runPolicyKey = 'HKLM\Software\Microsoft\Windows\CurrentVersion\Run'
|
||||
$personalizationPolicyKey = 'HKLM\Software\Policies\Microsoft\Windows\Personalization'
|
||||
$personalizationCspKey = 'HKLM\Software\Microsoft\Windows\CurrentVersion\PersonalizationCSP'
|
||||
$cloudContentPolicyKey = 'HKLM\Software\Policies\Microsoft\Windows\CloudContent'
|
||||
$providerClassId = '{D789CFD8-5AD4-489F-9B83-7EB5D9D09335}'
|
||||
$welcomeWallpaperCommand = 'powershell.exe -NoLogo -NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -File "{0}" -BaseImagePath "{1}"' -f `
|
||||
$WelcomeWallpaperScriptPath,$WelcomeWallpaperBasePath
|
||||
@@ -111,7 +113,16 @@ $policies = @(
|
||||
# local payload lets the first desktop render without depending on SMB.
|
||||
@{ Key = $runPolicyKey; Name = 'SGUWelcomeWallpaper'; Type = 'String'; Value = $welcomeWallpaperCommand },
|
||||
@{ Key = $personalizationPolicyKey; Name = 'LockScreenImage'; Type = 'String'; Value = $WelcomeWallpaperBasePath },
|
||||
@{ Key = $personalizationPolicyKey; Name = 'NoChangingLockScreen'; Type = 'DWord'; Value = 1 }
|
||||
@{ Key = $personalizationPolicyKey; Name = 'NoChangingLockScreen'; Type = 'DWord'; Value = 1 },
|
||||
|
||||
# Windows 11 Pro can ignore the legacy lock-screen policy even though it is
|
||||
# present in the registry. PersonalizationCSP provides the same local image
|
||||
# to Pro while remaining harmless on Enterprise and LTSC editions.
|
||||
@{ Key = $personalizationCspKey; Name = 'LockScreenImagePath'; Type = 'String'; Value = $WelcomeWallpaperBasePath },
|
||||
@{ Key = $personalizationCspKey; Name = 'LockScreenImageUrl'; Type = 'String'; Value = $WelcomeWallpaperBasePath },
|
||||
@{ Key = $personalizationCspKey; Name = 'LockScreenImageStatus'; Type = 'DWord'; Value = 1 },
|
||||
@{ Key = $cloudContentPolicyKey; Name = 'DisableWindowsSpotlightFeatures'; Type = 'DWord'; Value = 1 },
|
||||
@{ Key = $cloudContentPolicyKey; Name = 'DisableWindowsSpotlightOnLockScreen'; Type = 'DWord'; Value = 1 }
|
||||
)
|
||||
|
||||
$powerSettingIds = @(
|
||||
|
||||
Reference in New Issue
Block a user