Smooth Roaming + Responsive Design

In this post, we look at adding session reconnection event handling to our responsive design prototype using the Citrix XenApp Mobile Application SDK. Be sure to check out the video of the prototype.

In a previous article, we looked at using responsive design with enterprise applications by utilizing the Citrix XenApp Mobile Application SDK. Jonathan Chin left an interesting comment about hooking up an event handler to apply the responsive design to a reconnection event.  So, I decided to investigate doing just that and, as it turns out, it isn’t that hard.  

In the previous version, the responsive design code only kicked in on session initiation (i.e. logon) – meaning if you started a session on a fat client and then reconnected to the session on a mobile device, then the fat client display would show up on the mobile device. We don’t want that. So, by catching the reconnection event, we can re-style the app at any point (session initiation or reconnection). Start the application on a fat client and then reconnect via a mobile device and the mobile style will kick in (and vice versa).

Here’s the bit of code to take care of it (if you don’t care about the code and just want to skip to the download, just follow this link):


private static extern bool WTSRegisterSessionNotification(IntPtr hWnd, [MarshalAs(UnmanagedType.U4)]int dwFlags);

private static extern bool WTSUnRegisterSessionNotification(IntPtr hWnd);

private const int NOTIFY_FOR_THIS_SESSION = 0;
private const int WM_WTSSESSION_CHANGE = 0x2b1;
private const int WTS_REMOTE_CONNECT = 0x3;
private const int WTS_REMOTE_DISCONNECT = 0x4;
private bool registered = false;

protected override void OnHandleDestroyed(EventArgs e)
    // unregister the handle before it gets destroyed


protected override void OnHandleCreated(EventArgs e)
    registered = WTSRegisterSessionNotification(Handle, NOTIFY_FOR_THIS_SESSION);

protected override void WndProc(ref Message m)
    if (m.Msg == WM_WTSSESSION_CHANGE)
        if (m.WParam.ToInt32() == WTS_REMOTE_CONNECT)
            // The session is in the reconnect state, so style the app for the new session

        if (m.WParam.ToInt32() == WTS_REMOTE_DISCONNECT)
            // The session is in the disconnect state, so close the CMP if it is open
            if (this.cmp != null && this.cmp.IsChannelOpen())
                catch {}
    base.WndProc(ref m);


Try It Out Yourself

Want to try it out yourself?  I have made the program and the source available so you can beat it up and come up with some more ideas.  You can download it here.


Responsive Design for Enterprise Applications

Responsive Design that web developers use can now be applied to Enterprise Applications thanks to the Citrix Mobile SDK. This post will give you a glimpse of what is possible to get your wheels turning.

Have you heard of Responsive Web Design?  The term was coined by Ethan Marcotte in his article on A List Apart.  The gist of the idea is that web pages can be designed to adapt or respond to the entity that is viewing it.  The Boston Globe’s website is a good example of responsive design.  You can see by the screenshots below, that given enough screen real estate, the website has a 3 column layout.  But, as the screen width starts to shrink, the layout is adjusted to 2 columns and then 1 column.  Also, the navigation changes to better suit the layout and images are adjusted or hidden.


Applying Responsive Design to Enterprise Applications

Just like web pages, enterprise applications are starting to get viewed on a myriad of devices.  What if we could take some of the same techniques web designers are using and apply that to enterprise applications?  Well, as it turns out, we can with the help of the Citrix XenApp 6.5 Mobile Application SDK.  By using the Mobile Application SDK, enterprise applications that are hosted on a XenApp 6.5 server can respond to the type of device using the application.

Responsive Application Example

As an example, I wrote an application that takes data from EdgeSight about the types of Citrix clients used in an environment.  The application displays this information in a chart as well as a table.  I then published this application from AppCenter on a XenApp 6.5 server and launched it using a fat client.  You will notice that both the chart and the data table are shown as well as a menu strip at the top to select a chart type.


Now, if you launch the exact same application from the exact same server using a mobile device, some very interesting things happen:


  1. Only the chart is shown initially.  If you rotate the device, only the data table is shown.
  2. The application’s window chrome is gone.
  3. The width and the height of the application were changed to the width and height of the device.
  4. Tapping the chart image brings up the device’s native picker.
  5. Changing the orientation of the device changes the display.

Check out this short video for a demo:


Try It Out Yourself

Want to try it out yourself?  I have made the program and the source available so you can beat it up and come up with some more ideas.  You can download it here.


Installing and Using the Citrix XenApp 6.5 Mobile Application SDK

In this post, we will go over the installation steps of the Citrix XenApp 6.5 Mobile Application SDK, explorer what is added to the XenApp 6.5 server during installation, and compile one of the samples given in the SDK.

Now that we have setting up an Android emulator out of the way, let’s take a look at installing the Citrix XenApp 6.5 Mobile Application SDK and what the install does to a XenApp 6.5 server.

There are 2 parts that you need in order to develop applications that utilize mobile capabilities on a XenApp 6.5 server:

  1. The XenApp 6.5 Mobility Pack – this is the part that goes on the XenApp 6.5 server.
  2. The Citrix XenApp 6.5 Mobile Application SDK – this is the part you use to develop mobile applications.


XenApp 6.5 Mobility Pack

When you install the Mobility Pack, 2 new services are added to your XenApp server:

  1. Citrix Location and Sensor Virtual Channel Service – this service enables a server side application to leverage Location and Sensor capabilities.
  2. Citrix Mobile Receiver Virtual Channel Service – this service enables a server side application to use mobile device capabilities.

These 2 virtual channels are kept separate for security reasons.  Maybe you want to have mobile device capabilities available, but you cannot enable GPS features due to security compliance.  Location services are disabled on the Citrix Receiver by default. The way to enable the location capabilities is via Citrix policies.  In order to use these policies, you will need to install the Citrix Group Policy Client-Side Extensions.  These extensions are part of the XenApp Mobility Pack .zip file.

This policy is located under ICA\Client Sensors\Location. Notice that by default, location is disabled.


Citrix XenApp 6.5 Mobile Application SDK

So, the requirements for the Citrix XenApp 6.5 Mobile Application SDK state that you need Windows 7 64 bit (and the MSI is even named XenApp65MobileApplicationSdk64), but it installs to ..\Program Files (x86)\Citrix\MobilitySDK\.  I tried installing the SDK on a Windows 7 32 bit system as well and it worked, so I’m not sure if something absolutely will not work on 32 bit.

I’m using Visual Studio for the examples.  It appears that Visual Studio Express (free) will work as well, but I haven’t tested that myself.

Anyway, the documentation that comes with the SDK is pretty comprehensive so I’m not going to rehash it here.  Since I will be showing you some of the examples using .Net, I do want to point out that you will need to run one of the following commands on your development machine in order for things to work:

Regsvr32 cmpcom.dll
Regsvr32 cmpcom64.dll

Notice that there is a 32 bit or a 64 bit DLL register. So again, not sure why Windows 7 64bit is a requirement for development. Anyway, make sure you run the appropriate command above as administrator, otherwise you may receive an error stating “The module was loaded but the call to DllRegisterServer failed with error code 0x80070005” (which is a permissions error).

Compiling Examples

The final part of this article will focus on compiling and using the examples that come with the SDK.  The one I’m going to point out here is the picker example.  This example uses the native device’s UI to display a list of options.  The example is actually a console application that has no graphics, so it is actually using the local device’s display mechanisms rather than trying to do some trickery on the XenApp server side.  So, here we go…

  1. Browse to \Program Files (x86)\Citrix\MobilitySDK\samples\native\showpicker
  2. Double click on showpicker.sln to open the solution in Visual Studio
  3. Build the solution by pressing F6
  4. This will create an executable in \Program Files (x86)\Citrix\MobilitySDK\samples\native\Win32\Debug\showpicker.exe
  5. Copy this showpicker.exe to your XenApp 6.5 server (I copied mine to \Program Files (x86)\Mobility\picker\showpicker.exe)
  6. Publish the application via Citrix AppCenter
  7. Launch the published application using an Android device (or emulator) with the latest Citrix Receiver installed.

NOTE: You may receive an error message that states “The program can’t start because MSVCR100D.dll is missing from your computer…”  Here’s why – the solution was built in debug mode.  Thus, debug DLL’s (notice the “D” in the DLL name) need to be on the XenApp 6.5 server.  Here is what you can do:


  • From: \Program Files (x86)\Microsoft Visual Studio 10.0\VC\redist\Debug_NonRedist\x86\Microsoft.VC100.DebugCRT\msvcr100d.dll on your development machine
  • To: \Windows\SysWOW64\msvcr100d.dll on your XenApp 6.5 server
You could technically build the solution in Release mode instead of Debug mode and be okay, but to perform remote debugging, you will want to have the debug DLL on your remote machine.  Speaking of debugging, here are 2 great write-ups on how to debug the mobile applications:


The Result

Here is what the end result looks like.

Once you pick one of the colors, the console application will give you feedback on the chosen item.  When the appropriate receiver is available for iOS, then the native iOS selector would be shown with no code changes on the developer’s part.  That is pretty cool!

In the next article on this topic, I will show you how to use mobile device orientation to change what is displayed to an end user.  The example will include data and graphics.  Stay tuned…

Citrix XenApp 6.0 to XenApp 6.5 PowerShell Upgrade Utility Under the Hood

Citrix recently released XenApp 6.5. However, there is not a way to do an in-place upgrade from XenApp 6.0 to XenApp 6.5. This means that the Citrix administrator will have to uninstall XenApp 6.0 components and install XenApp 6.5 components. Citrix released a PowerShell utility to help in this process, and in this post I break that utility down into a Visio flowchart to you can understand what is going on behind the scenes.

Ever since I was a kid, I liked taking things apart.  Citrix recently came out with a PowerShell tool to help administrators turn XenApp 6.0 servers into XenApp 6.5 servers because unfortunately (or fortunately depending on the way you look at it), there is no in-place upgrade option from XenApp 6.0 to XenApp 6.5.

This utility is a PowerShell script that performs the following:

  • Checks to see if XenApp 6.0 is installed or not, and if the XenApp 6.5 installer is available.
  • Prompts for a password to silently run the install process after reboot.
  • Uninstalls XenApp 6.0 components. By default these include the Online-Plugin, Management Consoles, and XenApp Application Delivery role. Other components are included in the script and can be enabled for automatic removal.
  • Installs XenApp 6.5 and, by default, joins the server to the farm as a worker.
  • Verifies the join is successful by checking to see if the IMA service is running.
I think this script is really cool so I had to take it apart to see just how the script was doing these things.  I made some notes in the form of a flowchart and have provided the flowchart here for your viewing pleasure.


– or-
Click the picture below for .gif image of the flowchart

You can download the tool from Citrix’s website ->

How to Install the Citrix XenApp 6 PowerShell Cmdlets

PowerShell is the new API for Citrix XenApp starting with version 6. Whether you want to write interactive applications or work with your XenApp farm via command line, you first need to set up the XenApp 6 PowerShell SDK. This post will step you through setting up the Citrix XenApp 6 PowerShell SDK in your environment.

PowerShell is the new API for Citrix XenApp starting with version 6.  Whether you want to write interactive applications or work with your XenApp farm via command line, you first need to set up the XenApp 6 PowerShell SDK.  This post will step you through setting up the Citrix XenApp 6 PowerShell SDK in your environment.

Installing the Citrix XenApp 6 PowerShell cmdlets

Before we get started, you first need to download and install the Citrix XenApp PowerShell SDK (which includes the XenApp cmdlets). You can download the SDK here:

I recommend installing this on one of your XenApp 6 servers.  Technically, you can install this on a workstation and use remoting to remote all the commands to a XenApp 6 server, but it is very messy and doesn’t always work from my experience.  Anyway, during the setup of the SDK, you will be asked to set the PowerShell execution policy to AllSigned.  It is a good idea to leave this box checked to prevent malicious PowerShell scripts from ruining your day.

XA6 SDK Execution Policy

Adding the Snapins to your Runspace

After installation is complete, the assemblies will be loaded into the GAC (Global Assembly Cache).  Every time you want to use the Citrix XenApp cmdlets, you will need to add the snapins to your PowerShell runspace.  This can be done by launching PowerShell and using the Add-PSSnapin command as seen below:

Citrix PSSnapin

Adding the snapins will allow you to execute all the XenApp cmdlets.  Alternatively,  you can launch PowerShell from the Citrix/XenApp Server SDK folder in the  start menu as seen below.  This will launch a PowerShell runspace with all the Citrix snapins loaded and ready to go. 

XenApp PoSH

You are now ready to start PowerShelling your Citrix environment.

Bulk Update XenApp 6 Published Application Properties with PowerShell

There are times when you need to update a property on multiple XenApp published applications. If you only have a few applications to update, this can be done via the management console. However, if you have more than a few applications to update, then PowerShell is the way to go. In this post, I will show you how to use PowerShell to update published application properties on multiple applications at the same time.

Disclaimer: This article deals with Citrix XenApp 6 and above only. PowerShell cmdlets are available for XenApp 5.0 on Windows Server 2003 and 2008; however, the cmdlets are CTP (Community Technology Preview) and will likely never get “officially” released. The cmdlets in XenApp 5 are not always the same as the cmdlets in XenApp 6.

Have you ever had the need to update a lot of Citrix XenApp published application properties at the same time?  For instance, suppose you publish all your Citrix XenApp applications with sound disabled.  Then, somebody comes up to you and says “hey, we need to have all our applications support sound.  Thanks.”  If the only tool you had to use was the Citrix console, you will probably get carpal tunnel syndrome from all the mouse clicking you will need to do.  Luckily, the management console is not your only tool to solve this dilemma.  By using PowerShell and the Citrix XenApp 6 PowerShell cmdlets, this task is reduced to a single command.

Updating all Citrix XenApp 6 Published Applications with PowerShell

Note Note: if you haven’t already done so, you need to install the Citrix XenApp 6 PowerShell SDK to use the XenApp PowerShell cmdlets.  Refer to this post for more information.

The following command will set every published application in the farm to have an audio type of Basic:

Set-XAApplication * -AudioType Basic

To break this down some more:

  • Set-XAApplication will set a property on any application
  • The * is the search string to match.  If you wanted to match any application that started with test, you could use test*.
  • -AudioType is the property we are setting.  In this case, AudioType is an enumeration.  AudioType can be set to Unknown, None, or Basic

To see a list of all the properties that can be set on a XenApp published application, check out the help file that comes with the XenApp 6 PowerShell SDK, use Get-Member in PowerShell, or check out this page.

Updating Citrix XenApp 6 Published Applications in a Folder

If you only wanted to update some publised applications in a particular folder, you can first select all applications in a folder and then pass those application objects to the Set-XAApplication cmdlet like so:

Get-XAApplication –FolderPath Applications/Testing | Set-XAApplication –PassThru –AudioType Basic

Breaking it down:

  • Get-XAApplication gets a collection of XenApp applications
  • -FolderPath lets Get-XAApplication know that we just want to get applications in a particular folder
  • Applications/Testing is the folder that holds the applications we want.
  • We then pipe (using the pipe ‘|’ character) all these XenApp application objects into the Set-XAApplication cmdlet (the same cmdlet we used above)
  • This time, we use the –PassThru parameter to let Set-XAApplication cmdlet know that we are not going to search for some applications, but instead we are going to pass one or more XenApp application objects to it.
  • The rest of the parameters are the same as above

There you have it.  We have now set a property for all applications using one command, as well as set application properties using selection criteria.  Hope this helps you out with your XenApp environment.

Citrix XenApp 6 PowerShell SDK: Getting a List of Applications with C#

This post will show you how to use the Citrix XenApp 6 PowerShell SDK to obtain a list of applications from your XenApp 6 farm. We’ll look at how to do this with using the PowerShell Runspace and how to do this using the Citrix XenApp 6 wrapper assembly.

This post will show you how to use the Citrix XenApp 6 PowerShell SDK to obtain a list of applications from your XenApp 6 farm. We’ll look at how to do this with using the PowerShell Runspace and how to do this using the Citrix XenApp 6 wrapper assembly. The examples used in this post will be using an ASP.NET website, but the code can be reused in a Windows application, Console application, web service, etc.

Note Note: Be sure to read the getting started post for information about adding the correct references to your project.

Using the PowerShell Runspace

I added a Web Form to my project named RunSpaceFactory.aspx. Here is what it looks like:

using System.Management.Automation;
using System.Management.Automation.Runspaces;

namespace WebApplication1
    public partial class RunSpaceFactory : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
            Runspace rs = RunspaceFactory.CreateRunspace();

            PowerShell ps = PowerShell.Create();
            ps.Runspace = rs;

            PSSnapInException ex;
            rs.RunspaceConfiguration.AddPSSnapIn("Citrix.XenApp.Commands", out ex);


            // You can add a search string like this:
            // ps.AddCommand("Get-XAApplication").AddParameter("BrowserName", "n*");

            foreach (PSObject app in ps.Invoke())


Lines 10 – 14 are standard PowerShell things you would do to work with PowerShell in any C# application.

Line 17 adds the Citrix PowerShell SnapIn to the Runspace so we can execute the Citrix commands.

Lines 19 – 28 lists all the applications in the XenApp 6 farm.

Note line 21 & 22. If line 22 was uncommented, this excerpt would list all the applications that start with the letter ‘n’ by adding a parameter to the Get-XAApplication command. You can use any matching pattern here like ‘%o*’ which would get all applications whose second letter is ‘o’.

Using the Citrix XenApp 6 Wrapper Assembly

When using the Citrix XenApp 6 wrapper assembly, you first need to add references to the appropriate DLLs to your project. The DLLs can be found in %ProgramFiles%\Citrix\XenApp Server SDK\bin


After adding the references, here is the code to accomplish the same task from above:

using System.Management.Automation;
using System.Management.Automation.Runspaces;

using Citrix.Management.Automation;
using Citrix.XenApp.Sdk;
using Citrix.XenApp.Commands;

namespace WebApplication1
    public partial class ListApplications : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
            GetXAApplicationByName apps = new GetXAApplicationByName();
            apps.BrowserName = new string[] {"*"};

            foreach (PSObject _app in CitrixRunspaceFactory.DefaultRunspace.ExecuteCommand(apps))
                XAApplication app = (XAApplication)_app.BaseObject;


As you can see, there is quite a bit less code here.

Line 14 sets up all your Runspace stuff and adds the appropriate command.

Line 15 adds a parameter to the command. This is an interesting line because the BrowserName property expects an array of strings. I’m just passing one string here, but you could pass several to match. For example, string[] {“n*”, “%o*”} would find all apps that either started with the letter ‘n’ or the second letter was ‘o’.

We loop through the results in lines 18 – 24. Note that I cast the PSObject (generic PowerShell object) to a XAApplication object. This helps with the type safety and IntelliSense. To be fair, you can do the exact same thing in the PowerShell Runspace example above if you wanted.

The Results

Here is what the Citrix Delivery Services Console looks like concerning published applications:

Citrix Delivery Services Console Applications

Here is the output from both examples:


What’s Next?

The next examples will show you how to publish and application as well as how to manage sessions. You can also get a jump start by downloading the example code below:

Getting Started with the Citrix XenApp PowerShell SDK and C#

In XenApp 6, MFCOM is out and PowerShell is in. This post is the first in a series to help you understand how to develop appliations that utilize the Citrix XenApp 6 PowerShell SDK and Microsoft C#.

At BriForum 2010, Brandon Shell and I presented a session on how to make the transition from MFCOM to PowerShell.  At the end of the session, I presented several examples on how to use the XenApp PowerShell SDK in C#.  I wanted to share some of the details on those examples in a few blog posts.  This first blog post will detail what is needed to get started developing applications that leverage the Citrix XenApp 6 PowerShell SDK.

What you need

To get started, you need to set up a development environment.  You really only need two things:

Actually, there isn’t anything set in stone that says you *have* to use Visual Studio, but it will make your life a whole lot easier.  I recommend installing Visual Studio on a XenApp server because remoting in PowerShell is less than desirable for these examples.

Creating your first project

After you install Visual Studio and the Citrix XenApp 6 PowerShell SDK, you are ready to get started with your first project.  The examples I will be showing will be web projects.  So, launch Visual Studio and select  File > New > Project…

Visual Studio New Project


Add a Reference to System.Management.Automation

After you create your Project, you need to add a reference to System.Management.Automation.dll in order to do stuff with PowerShell in your project.  If you go looking for this DLL in the file system, you will find it at %ProgramFiles%\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0 <- DO NOT USE THIS FILE.  The version of System.Management.Automation you want is in the GAC.

Normally, if you want to add a reference to an assembly that lives in the GAC to your project, you can just right-click your project in Visual Studio, select Add Reference and browse for the name.  But, for some reason, this assembly isn’t like the others.  You actually have to close your project in Visual Studio and manually add a reference to System.Management.Automation by editing the .csproj file.  For example, if your project name was WebApplication1, you would need to edit WebApplication1.csproj (you can use Notepad to edit this file if you like since this file is just XML) and manually add:

<Reference Include=”System.Management.Automation” />


Once you manually add this reference to your project file, you will want to add a couple of using statement to your code files that will deal with PowerShell:

using System.Management.Automation;
using System.Management.Automation.Runspaces;


To Wrap or not to Wrap

There are basically two ways to use the Citrix XenApp 6 PoweShell SDK in a C# project:

  1. Use “traditional” PowerShell Runspace (uses common PowerShell Runspaces)
  2. Use the XenApp 6 wrapper assemply (wraps each command and paramter in a Class for safe typing)

There are pros and cons for both:

“Traditional” PowerShell Runspace pros:

  • Easy to convert existing PowerShell scripts to C#.
  • You can log all the PowerShell commands and save before running – kind or like Microsoft Exchange 2007 does.

“Traditional” PowerShell Runspace cons:

  • No type safety – meaning that commands and parameters are specified as strings – which means you can mess up by typing the wrong string making troubleshooting difficult.
  • No IntelliSense for XenApp commands/odjects in Visual Studio.

XenApp 6 Wrapper pros:

  • Type safety.  Every command and parameter is wrapped in a class so there is no chance of misspelling a string parameter or passing an incorrect parameter.
  • Enables IntelliSense in Visual Studio.

XenApp 6 Wrapper cons:

  • Does not translate well to PowerShell commands.  For instance, the PowerShell command to get an application is Get-XAApplication.  The wrapper assembly’s command is GetXAApplicationByName().

I like using the wrapper assembly personally, but in the end it is all the same.

What’s Next?

I’ll be writing a few more posts on concrete examples of using the XenApp 6 PowerShell SDK.  Stay tuned…

MFCOM to PowerShell: How to Make the Transition

MFCOM has been the de facto standard for programmatically interfacing with Citrix XenApp. Whether you wanted to write a simple script or develop an application that interfaced with XenApp, MFCOM was the answer. Now, Citrix is committed to building their management architecture on PowerShell–not just for XenApp, but for all Citrix products. That’s great news for standardization across platforms and aligning with Microsoft on using PowerShell for management architectures. Now, the question is how do you take what you know about MFCOM and translate that to PowerShell?

As you may of may not already know, Citrix has committed to building their management architecture (and SDK) on PowerShell – not just for XenApp, but for all Citrix products.

In XenApp 6.0, MFCOM is not available anymore. The underlying architecture has changed dramatically enough to make backward compatibility with MFCOM impossible. The replacement for MFCOM is PowerShell. MFCOM-based scripts need to be completely re-written in XenApp cmdlets. In most cases, the conversion should be simple and most MFCOM scripts can be replaced with one-liner PowerShell commands.

Source: Citrix XenApp 6 PowerShell SDK reference manual.

That’s great news for standardization across platforms and aligning with Microsoft on using PowerShell for management architectures.  But, that begs the question – what do you do about all those scripts and applications that leverage MFCOM going forward?  I’ll be presenting a session at BriForum 2010 with Brandon Shell about this very topic.  The session will cover:

  • General Object Orientation
  • Specific Citrix XenApp objects
  • Examples of how scripts and applications were done with MFCOM
  • Converting scripts and applications to use PowerShell
  • PowerShell remoting
  • Availability of PowerShell cmdlets on XenApp 5 and XenApp 6
  • C# applications leveraging the PowerShell command wrapper

BriForum takes place from June 15th to June 17th at the Hilton Chicago Hotel.  There is still time to register.

Digging in to Citrix Configuration Logging: Exploring the Database

This is the fifth part in a series on Citrix XenApp Configuration Logging. This part will focus on the database schema, the information contained in the database, and how to decode certain parts of the data.

This is the fifth part in the Citrix Configuration Logging Series. In part 1, we discussed what Citrix Configuration Logging was.  In part 2, we discussed how to prepare the database to log configuration changes. In part 3, we discussed how to set up the Citrix XenApp farm for Configuration Logging, in part 4, we looked at the “out of the box” reporting tools. In this part, we will look at the back end database schema.

Schema on the Surface

Here is what the database schema looks like on the surface.


Just 3 tables – looks pretty easy…  But, if you look at some of the data in those tables, things become less obvious.  Let’s break each table down:

CtxLog_AdminTask_LogEntry – Every change to the XenApp farms creates a new row here.
LogEntry_RecordID Unique Identifier (primary key)
SiteId I honestly don’t know why this is here.  It seems like it might be some kind of farm identifier, but you can only have one farm per database.
LogEvent This holds events that happen on the log (database) as a whole.  This is a numeric value that corresponds to an enumeration.  Possible values are:

  • 0= None
  • 1= Created
  • 2= Cleared
DateTime Date/Time the change occurred.
LogonUserName The user that made the change.
LogonUserId The SID of the user that made the change.
LogonHostName Hostname of server that joins the farm.
LogonHostId SID of a server that joins the farm.
HostName IMA server used to make the change – remember that every change has to go through IMA.
HostId SID of the host HostName above.
Status Status of the change.  This is a numeric value that corresponds to an enumeration.  Possible values are:

  • 0 = Success
  • 1 = Neither success nor failure
  • 2 = Failure
CtxLog_AdminTask_Object – Object(s) changed.
Object_RecordID Unique Identifier (primary key)
SiteId Again – don’t know why this is here.
LogEntry_RecordID Foreign key to CtxLog_AdminTask_LogEntry table.
SequenceID Another one I’m not sure about.
AdminTaskType Enumeration – type of task performed:

  • 0 = None
  • 1 = Created
  • 2 = Modified
  • 3 = Removed
ObjectType Enumeration:

  • 0 = Application
  • 1 = Application Isolation Environment (AIE)
  • 2 = AIE Application
  • 4 = Farm
  • 5 = File Type Association
  • 6 = Folder
  • 7 = Installation Manager Application
  • 8 = Printer
  • 9 = Server
  • 10 = Server Group
  • 11 = User
  • 12 = Policy
  • 13 = Monitoring Profile
  • 14 = Load Manager
  • 15 = Virtual IP Farm Range
  • 16 = Virtual IP Server Range
  • 17 = Print Driver
  • 18 = Database
  • 19 = Zone
ObjectName Name of the object changed.
ObjectUid Internal object ID.  More specifically, this value comes from the object’s ID property in MFCOM.
PropertyList XML field.  Holds before and after values.
AdminTaskFormatResID ID of field in language specific resource file.
CtxLog_AdminTask_ReferenceList – Some objects reference other objects.  For instance, a published application can reference many server objects.  This table keeps track of changes to referenced objects.
ReferenceList_RecordID Unique Identifier (primary key)
Object_RecordID Foreign key to CtxLog_AdminTask_Object table.
ObjectType Same as parent table.
ObjectNamesOriginal Tab delimited list of the names of the original referenced objects.
ObjectIdsOriginal Tab delimited list of internal object IDs of the original referenced objects.
ObjectNamesAdded Tab delimited list of the names of the added referenced objects.
ObjectIdsAdded Tab delimited list of internal object IDs of the added referenced objects.
ObjectNamesRemoved Tab delimited list of the names of the removed referenced objects.
FormatResId_Added Resource IDs of added objects.
FormatResId_Removed Resource IDs of removed objects.


Identifying Changes

As stated above, the PropertyList field in the CtxLog_AdminTask_Object table is a XML field.  This field maps out the before and after values of each property of an object after a change.  Here is an excerpt of what a PropertyList field looks like:

<?xml version="1.0"?>
  . . .
  <property nameresid="290042">
    <valuelist original="0">
        <valstr>Notepad - test</valstr>
    <valuelist original="1">
    . . .

Notice that each property has a value where original=”0” or original=”1”.   If the two values are different, that is a change.  Original=”1” is the before value and original=”0” is the after value (that seems backwards to me).  So, from the excerpt above, we can see that “Notepad” was renamed to “Notepad – test”.

Resource IDs

Several of the fields have “ResID” somewhere in their name.  This is short for Resource ID.  The values in these fields are numeric and correspond to a language specific Resource File.  For instance, the nameresid in the excerpt above is 290042.  This maps to “Display Name” in the en-US resource file; however, 290042 maps to “Anzeigename” in the de-DE resource file.  The resource file(s) used to decode the numbers can be found on the computer running the AMC at:

%ProgramFiles%\Common Files\Citrix\Access Management Console – Report Center\Reports\ConfigurationLoggingReport

The English resources are located in ConfigurationLoggingReport.dll.  Other localized languages can be found in a subdirectory of the path given above.  For instance, the German language resources would be in:

<above path>\de\ConfigurationLoggingReport.resources.dll

This concludes our “behind the scenes” look at the database schema.  Now that we know exactly what information is stored in the database and how to decipher the data, we will look at how to do some custom reporting in the final post in this series.