Note: This blogpost is also posted on my personal blog – https://itmicah.wordpress.com.
RES One Workspace has a lot of great options to preserve your settings between sessions. But some settings are not as easy to capture because there’s no file or registry setting for them. One of these troublemakers is the volume of the audio. If you’ve adjusted the volume in a session to be less than 100% or even muted the audio completely you’ll find yourself having to do this each time you start a new session (unless you’re on a dedicated persistent client of course).
So how can we remedy this situation? There are tools available like the Citrix Audio Volume Persistence Tool, although I’ve heard reports that this doesn’t work well with the Mute option. But the best tool is already installed in your image: PowerShell. I will share a building block with you that contains the following:
- An Execute Command task that runs a PowerShell script to save the volume level and mute status in the registry. It runs at logoff before other actions so the registry values can be captured.
- A global User Setting named Audio Volume that preserves the registry settings created by the previous script task.
- An Execute Command task that runs a PowerShell script to restore the volume level and mute status from the registry. It runs at logon after other actions so the captured registry settings will have been restored.
The PowerShell scripts are not that straight forward as audio control is not a native functionality in PowerShell, so I had to use the Add-Type command to add some C# code in order to be able to create Audio objects. But it works like a charm. Since I’m not a C# guru (yet) I borrowed the code from a blogpost on DeployHapiness.com.
I hope you’ll find it usefull.