Deploying the UE-V Agent in ConfigMgr 2012 Using Settings Storage Path

Using ConfigMgr to deploy the UE-V agent can present a nasty surprise if you try to specify the SettingsStoragePath using the %USERNAME% environment variable.

Microsoft released the User Experience Virtualization (or UE-V) agent with MDOP 2012 as a means of ensuring a consistent user experience across multiple devices, providing yet another tool to put to rest the pain that is “roaming profiles.”  The premise is simple: use XML files to store application settings and leverage the built-in Offline Files engine to sync them for reference between multiple machines.  No more going through all your favorite customizations in Microsoft Word to make it look the same on all your machines or virtualized instances; now your settings can follow you.

Obviously, this means you need a central storage location (Settings Storage Path) for these settings XML files. If you have your AD user accounts configured with home folders, this process is super easy: the UE-V agent will automatically detect and use the home folder as the Settings Storage Path without any need for further configuration.

However, if you don’t have home folders configured, or want to use an alternate location for storage, there are several methods of controlling this.  You can use the UE-V Group Policy ADMX Templates to configure the Settings Storage Path, you can use PowerShell to configure the agent with the installed PowerShell module, or you can set the path at install time using the SettingsStoragePath install property (the actual storage path is stored in the registry).

Typically, the assigned storage path leverages the %USERNAME% environment variable in order to automatically create and secure a subfolder in the storage location for the user.  However, if you are deploying the UE-V agent with Configuration Manager and attempting to set the SettingsStoragePath property using the %USERNAME% variable there is a catch.  If we set the property using %USERNAME% in the ConfigMgr command line (ex – SettingsStoragePath=\\server\share\%USERNAME%)…

…we get an unexpected result for our storage location…

This is because ConfigMgr evaluates the environment variable as it builds the command line, and because the installation is running in the SYSTEM context the %USERNAME% variable is replaced by “SYSTEM”

That property in turn gets written to the HKLM UE-V agent configuration in the registry…

…meaning not only all users of that machine will point to the same settings storage location, but all other machines that ConfigMgr installs the UE-V agent on using this command line will point to the same one.  Not a good thing!

Fortunately, there is a way we can prevent ConfigMgr from evaluating the variable by taking advantage of how Windows interprets command lines.  By adding a caret (^) character in front of the % character, ConfigMgr doesn’t see it as anything needing evaluation.  In turn, Windows will treat the character following the caret as a standard character and include it in the execution as if it were a normal string, stripping out the carets at execution time.  So if we modify our Deployment Type to use ^%USERNAME^% in the command line (ex – SettingsStoragePath=\\server\share\^%USERNAME^%)…

…we see that the command line is properly built…

…the registry entry is now written correctly…

…and the UE-V agent uses a settings storage location corresponding to the username of the currently logged in user!

 

 

email

Written by , Posted .