VMware Horizon Community
JustSomeGuyDude
Contributor
Contributor

VMware DEM Persistent Sound Control Panel Settings - NOAD

I just wanted to share my workaround for persistent Sound Control Panel settings without third party tools (i.e. Default audio output device, disabled/enabled devices). On the golden image, you must first change the permissions in the Registry to allow "Users" the ability to Set Value on This Key and Subkeys for HKLM\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio. Then create a Logon and Logoff task in DEM that point to two scripts for importing and exporting audio settings. These scripts will have to be tailored to export to your Profile share. If you are having trouble running these, check your execution policy on x86 Powershell on the Golden Image.

Logoff task command: C:\windows\system32\windowspowershell\v1.0\powershell.exe \\ProfileServer\CONFIGDirectory$\Scripts\AudioExport.ps1

Logoff task settings: Timeout = 5 seconds, Run Task = Before

AudioExport.ps1 (Stored in a script directory on DEM server Config directory)

invoke-command {reg export 'HKLM\Software\Microsoft\Windows\CurrentVersion\MMDevices\Audio' \\ProfileServer\Profiles$\$env:username\Archives\Audio.reg /y}

 

Logon task command: C:\windows\system32\windowspowershell\v1.0\powershell.exe \\ProfileServer\CONFIGDirectory$\Scripts\AudioImport.ps1

Logon task settings: Timeout = 5 seconds, Run Task = Before

AudioImport.ps1 (Stored in a script directory on DEM server Config directory)

regedit /s \\ProfileServer\Profiles$\$env:username\Archives\Audio.reg

 

I tried using privilege elevation to do this before changing the permissions in the registry but there is always an error with NOAD config mentioning something about "Tokens not being configured" in the flex engine log. Doesn't seem to matter whether I try Hash or Elevated Task. I'd rather not mess with reg permissions but this was the only way I found without a third party tool. I'm not sure why Microsoft puts User controlled settings down in HKLM instead of HKCU.

Labels (3)
0 Replies