UPDATE: Citrix obviously liked my idea and released their own tool with the same functionality. https://support.citrix.com/article/CTX206888 – it just lacks the Delay Options, but the binary does pretty much the same. oh well… i should have copyrighted it before 😛
i should have written this article already long time ago, but instead i just posted to some Citrix forums and gave out a link to my little tool. a few people already downloaded it and its probably used in quite some environments over the world. anyway – here comes finally a proper blog post about it.
since Windows Server 2008 the volume level and mute settings are not roamed anymore. this is not Citrix fault, but Microsoft decided to remove that feature and now the volume level is always set to 100% when a user logs on. even when reconnecting the audio volume gets maximized and mute disabled. this can be annoying in environments that need sound for their work. all windows versions higher than Vista do have this problem – means all Windows versions with the new audio subsystem.
it seems, that these settings are not stored in the registry – at least i was not able to find where and all i have found were some workarounds, but never a full complete solution.
one of my customers reported the same problem on a XenApp 6.5 and Windows 2008 R2 farm and since was not able to find a proper solution, i have coded a little tool that saves these settings in the registry and then loads them again on a login or reconnect. i have found some helpful source code online which hooked into the volume slider and from there i was able to get the actual settings.
the principle of my tool is pretty simple: it starts when the users logs on and then it runs in the background – watching the volume settings. as soon a user touches the volume slide or enables mute, the tool will write these settings to the registry. following keys are used:
Volume: the actual volume level. range: 0.000000 to 1.000000
Mute: mute level on or off. value: true or false
ReconnectTimer: this is a hidden setting, where a timer will delay the audio setting restore when a user reconnects to a session (in milliseconds)
so if your environment for some reason does need additional time to initialize the session and the volume restauration does not work, you can try to set ReconnectTimer in the registry to give it a little more time.
the same feature is available, when you start the volume.exe – it takes a commandline parameter (time in milliseconds) and will wait the supplied time until it restores the volume from the registry settings.
there is no GUI or configuration option – the tool just does, what it should.
i prefer to implement it in a windows GPO using the logon script section, but some customers used the startup folder or an existing logon script to launch it – this also seems to work fine.
in this case it would wait 2 seconds until it restores the volume settings from the registry.
i personally never used it with published apps, but thanks to Bernd Nömer who gave a helpful tipp in the citrix forums:
The only thing you should do is placing the volume.exe in the “LogoffCheckSysmodules” Reg.Key so that the volume.exe will be closed when using published Apps!
Windows Server 2012 R2 and XenApp 7:
Microsoft added some questionable default setting in Server 2012 R2 and Windows 8.1 – the logon script delay. if you dont disable this feature, the loginscript will delay 5 minutes and the volume.exe does not run properly. just disable the policy to fix that:
Computer Configuration\Administrative Templates\System\Group Policy\Configure Logon Script Delay.
thats it – now the users volume settings are all saved and restored in XenApp sessions. of course you need a roaming profile solution and save the registry keys mentioned above.
i have tested this utility on Server 2008 R2 and Server 2012 R2, but it should work on any OS newer than Vista. you will see the volume.exe process for every user on your XenApp server – dont worry, the binary is only 188 KB and it will take about 1.6MB RAM for each user. you can of course use a seperate policy and therefore limit the instances to a group, when for example not all users in your farm use audio.
the utility is coded in visual c++ 2010 express and is based on these code references:
you can download the volume.exe here: volume – the SHA1 for the volume.exe is 1EA3248E541D8B7AA035BA73CCE09A46DC797351
if you enjoyed my work, consider donating. I would appreciate it very much!