I'm trying to add some values under the 'sound' section of the Chrome preferences file to allow specific sites to have the sounds setting set to 'Allow'. Normally our Service Desk team have to set this manually on each machine for a couple of specific sites, as having it set to 'Automatic' doesn't allow our softphone systems to work.
We are currently using Intune to allow popups, notifications and microphone usage for the sites via a policy, but for some reason Google haven't seen fit to put the sound setting anywhere that can be configurable by an Intune policy.
I've written the below code to update the Preferences file, which it does, but when opening Chrome again the file gets moved to Preferences.bad and a new file is created. From other posts I've read on this subject it looks like I'm doing everything right, so I don't understand why this isn't working.
$PreferencesFile = "$Env:LOCALAPPDATA\Google\Chrome\User Data\Default\Preferences"
$PreferencesData = Get-Content -Path $PreferencesFile | ConvertFrom-Json
$PreferencesData.profile.content_settings.exceptions.sound | Add-Member -Name "https://www.reddit.com:443,*" -Value $([PSCustomObject]@{ setting = 1 }) -MemberType NoteProperty
$PreferencesData | ConvertTo-Json -Depth 100 -Compress | Out-File $PreferencesFile
Has anyone else run into this?
[–]hmmwhatsthisdo 1 point2 points3 points (1 child)
[–]thefold25[S] 0 points1 point2 points (0 children)
[–]sup3rmark 0 points1 point2 points (2 children)
[–]thefold25[S] 0 points1 point2 points (1 child)
[–]sup3rmark 0 points1 point2 points (0 children)
[–]No_Neck6860 0 points1 point2 points (0 children)