Scripting Citrix Online Plugin Settings

The Citrix Online Plugin has a number of settings that can be changed. This includes things as Window Size and Color Depth:

Session Options | Window size | Default | Full Screen | Requested Color Quality

In my case I wanted to preset the Window size to Full Screen so using Process Monitor I checked where the Online Plugin writes this setting. I Used a Filter that includes only the Online Plugin (PNAMain.exe) and the RegSetValue Operation:

Filter on Process Name is PNAMain.exe | Operation is RegSetValue

This yielded only few results:

RegSetValue Results

I changed the setting back and compared the registry, that made clear that the settings was written to “Configuration Model 000”.

Unfortunately the key is a REG_BINARY and I don’t like blindly importing this key into other systems since we have no idea what else we are importing.

However when editing the value in Regedit we see that the data looks like XML:

Edit Binary Value

I wrote a small PowerShell script to read this data into a string:

However the string is hard to read because it’s not formatted and indented so I tried to cast it to an XML Object but this errors because there is no Root element and because some element names have a space.

So let’s fix this:

And now we can load the data into an XML Object:

And finally we have readable data:

To change an item we can use the following code:

To change the Window Size from Default to Full Screen I needed to add an Item with Key UserDisplayDimensions and Value “fullscreen”. This can be done like this:

Before we can write the new data to the registry we need to get rid of the dummy root node and replace the underscores in the element names with a space again:

And the final step, write it back to the registry:

Leave a Reply

  1. Pingback: Friday Fun: Powershell with Citrix PNAgent. «

  2. Pingback: Virtual Intelligence Briefing » Friday Fun: Powershell with Citrix PNAgent. «

  3. Pingback: PNAgent Icon Data Algorithm - Remko Weijnen's Blog (Remko's Blog)