Files
claudetools/clients/cascades-tucson/scripts/fix-cmd-popup.ps1
Howard Enos 8d2ca14cac sync: auto-sync from HOWARD-HOME at 2026-07-17 14:14:41
Author: Howard Enos
Machine: HOWARD-HOME
Timestamp: 2026-07-17 14:14:41
2026-07-17 14:15:20 -07:00

20 lines
1.5 KiB
PowerShell

Import-Module GroupPolicy
$guid = '32d76052-4d92-446c-95fb-614653f84742'
# Remove the logon script (causing CMD popup) - GPP shortcuts work now
$scriptsDir = "\\cascades.local\SYSVOL\cascades.local\Policies\{$guid}\User\Scripts"
if (Test-Path $scriptsDir) { Remove-Item $scriptsDir -Recurse -Force; Write-Output "Removed Scripts dir" }
# Remove the script registry entries from kiosk GPO
$base = 'HKCU\Software\Microsoft\Windows\CurrentVersion\Group Policy\Scripts\Logon\0'
Remove-GPRegistryValue -Guid $guid -Key "$base\0" -ValueName 'Script' -ErrorAction SilentlyContinue
Remove-GPRegistryValue -Guid $guid -Key "$base\0" -ValueName 'Parameters' -ErrorAction SilentlyContinue
Remove-GPRegistryValue -Guid $guid -Key "$base\0" -ValueName 'IsPowershell' -ErrorAction SilentlyContinue
Remove-GPRegistryValue -Guid $guid -Key "$base" -ValueName 'GPO-ID' -ErrorAction SilentlyContinue
Remove-GPRegistryValue -Guid $guid -Key "$base" -ValueName 'SOM-ID' -ErrorAction SilentlyContinue
Remove-GPRegistryValue -Guid $guid -Key "$base" -ValueName 'FileSysPath' -ErrorAction SilentlyContinue
Remove-GPRegistryValue -Guid $guid -Key "$base" -ValueName 'DisplayName' -ErrorAction SilentlyContinue
Remove-GPRegistryValue -Guid $guid -Key "$base" -ValueName 'GPOName' -ErrorAction SilentlyContinue
Write-Output "Removed logon script GPO entries"
# Block Microsoft Store for caregivers
Set-GPRegistryValue -Guid $guid -Key 'HKCU\Software\Policies\Microsoft\WindowsStore' -ValueName 'RemoveWindowsStore' -Type DWord -Value 1 | Out-Null
Write-Output "Microsoft Store blocked"