Wednesday, 30 April 2014

Moving Personalisation Data from Individual exe's to Application Group

I have often had a quandary when it comes to the issue of Personalisation of applications as individual exe's that really should be an Application Group instead of an individual exe that is personalised.

Best Practice dictates that when personalising an application it should be placed into an Application Group, even if you are only intending to personalise one exe disparate to all others. The theory being if in the future you find you need to add other exe's to the group and maintain settings then this can easily be done.

One of the things I then come across is clients wanting to adhere to Best Practice and therefore creating an Application Group and moving to this instead of the individual exe being personalised. This leads to the burning question, what do we do about existing users? Looking at documentation and speaking to AppSense support there isn't any easy answer so usually its easy to go with the clean start approach. However there is an alternative (there are others including PSExport and SQL scripting but that's beyond me am afraid). The alternative being EMP File Utility. This is installed when installing the AppSense tools from the installation media. The documentation (in my eyes) isn't brilliant nor easy to follow, well I don't think so anyway. So for my own future memory here goes:

Export of Data

Firstly we need to export out an individual users personalisation, this is achieved by running EMP File Utility from the Start Menu - AppSense - Environment Manager - Tools.

Next we need to connect to the Personalisation Database, to do this entering a command along the lines of:

SET EMPFileUtilConnectionString=Data Source=(Database server\Instance);Initial Catalog=PersonalizationServer;Integrated Security=SSPI

Obviously entering the correct Database name and if required, Instance, the brackets are not needed in the command Line.

Once we have connected to the database we then need to perform the export using a command line in the following format:

EMPFileUtil EXPORT <username> <usergroup> <application> <database root> <output folder>

The above is taken from the Environment Manager Administrative Tools Guide, available from myappsense or the installation media. The username is in the form Domain\User and usergroup is the name of the Personalization Group. Database root refers to the root of the file tree, eg CSIDL_APPDATA, however for the purposes of exporting all data we use a wildcard *. The added benefit to this is that it also exports the fbr associated with the application. Following that we add a path to an empty folder we will populate with the relevant personalisation.

A correct example of this would be:

EMPFileUtil EXPORT Domain\User "Personalisation Group Name" "Individual personalised exe" * c:\exportedpers\username

Import of Data

The first step in importing this is to create an xml file. The format of this again is taken from the Admin Guide and is shown below:

<?xml version="1.0" encoding="utf-8"?>
      RetrieveSID="yes" >
          RootFolder="c:\TestImport\Notepad" />

It is worth noting that we can have multiple user sections as well as multiple applications for each user, to have additional users we just need to repeat <User going down to </User>. Most of the other information is self explanatory, type is either single for an individual exe (as per our requirements in this case) or group if we are exporting data out of an existing Application Group., delete existing does what it says on the tin.

We then save our xml somewhere and again using EMPFileUtil we use the following format of command:

EMPFileUtil IMPORT c:\exportedpers\username

And there we have it, its quite straightforward but obviously not practical if we have a huge number of users, but for the VIP users works a treat.

I guess its worth remembering there is also an EMP Registry Utility to just manipulate registry settings as well as a Migrate Utility which allows you to migrate user settings between disparate databases.

Apologies that this isn't very pretty to look at, I wanted to knock it up quick before I forgot what I've done.

Friday, 4 April 2014

Issues with Certificate Personalisation within Citrix Environment

Recently have been scratching my head over a certificate personalisation issue. Initially was thought affected all at all times but then found was an intermittent issue. Credit for this has to go to AppSense support for figuring why this was happening.

The end customer use folder redirection for many things (as many do these days), one of which being Cookies. Initially the thought is either this isn't working, or personalisation isn't working of certificates.

Easy way to check cert using powershell is:

This then lists all certs installed as that user, so you can easily check that it shows as you would expect. In this case this was the case so was a mystery why this wasn't working as expected. The good folks at AppSense support had been nobly assisting and had found that the ssoshell was kicking in, at times, before the folder redirection was in place. Now there are a few ways round this however for ease of admin went with adding a Process Start node to ensure that when ssoshell kicked in folder redirection for cookies was in place. Its a simple node but for completeness here is what it looks like:

Note much more to say on the matter really, other than works a charm. As per my usual caveat this is one way to solve a problem, other ways are available and may make more sense.


Welcome, it's been a long time coming but as is the way so much to do so little time. The purpose of this blog is as a repository of all the things I do (often with help of others I must add) that I think wow I'm going to need to remember that for future reference.

Hopefully it may help others who have had to tackle similar issues and save some time as well as reduce the levels of banging heads on desks.

Obviously anything read here are my views, and my ideas of tackling a specific issue at a given point in time, doesn't mean it's the best way to do it nor the way others may tackle the same issue but nonetheless hopefully will make sense. I have worked with the AppSense product suite for several years now and it's how I make my living on a daily basis and find it very interesting, each day seems to throw up new questions and new opportunities to learn which in humble opinion is a great way to spend time. Anyway that's enough of that. Hopefully I can help others and if not, at least will remember where I have written down my ideas.