Open sp1nkick opened 4 months ago
I think this helps create the registry key if it doesn't exist. I will test if it makes a difference.
`# Function to set registry key value with error handling function Set-RegistryValue { param ( [string]$Path, [string]$Name, [Object]$Value, [Microsoft.Win32.RegistryValueKind]$Type ) try { if (-not (Test-Path -Path $Path)) { New-Item -Path $Path -Force | Out-Null Write-Output "Created registry path: $Path" } Set-ItemProperty -Path $Path -Name $Name -Value $Value -Type $Type -ErrorAction Stop Write-Output "Successfully set $Name to $Value in $Path" } catch { Write-Error "Failed to set $Name in $Path. Error: $_" } }
Set-RegistryValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Value 0 -Type DWord
Set-RegistryValue -Path "HKCU:\Software\Classes\Local Settings\Software\Microsoft\Windows\Shell\Bags\AllFolders\Shell" -Name "FolderType" -Value "NotSpecified" -Type String `
Question about these and and HKCU in general: Can these settings be made on the image? Or run them at VM deployment? Thanks! I should have googled first. Looks like this is more useful with Intune than Scripted Actions. Sigh.
Tony, thank you for this script, this appears to be exactly what we are struggling with on a few deployments, users specifically on latest windows 11 enterprise pooled session host note slow speed, back button issues and search issues with the new windows 11 explorer. When I try to use your script it appears the paths are not there. Does this create them? Or should we be using this alongside some other script , or only against the gold desktop image?
When ran as a scripted action:
6aa8241d-1566-4645-86dd-99a5c827af11.zip
Should it be ran as intune/GPO policy against each user instead?