Add a Folder to the Write Cache drive of Multiple PVS Targets – PowerShell

I recently needed to create a folder on the Writecache disk for the persistence of Eventlog files. Unfortunatley the customer already had around 40 XenApp hosts deployed.

I wrote a script which can be run from a machine with the Citrix Powershell commandlets installed, ie DDC. This Script lists all the Targets in the site and pipes them to the create folder command.

Ensure you have enabled the Citrix Snapins first…

And heres the code I created…

Smart-X ControlUp and PVS Cache In Ram

When visiting a customer I’m often like to get a feel for the performance of their Citrix farm so I can see what improvements can be made. A fantastic tool for doing this is Smart-X Control-Up. Control-Up is the ultimate administration and real time monitoring tool. Not only can you see, in real time, what’s happening in your RDSH/VDI Farm but it also provides administrators with all the tools necessary to support and administer it. I like the analogy that its like a Medical ECG, you simply run the executable which then installs an agent on your VDI or RDSH hosts and then instantly you see the environments vital statistics.

VDI Environment in ControlUp

VDI Environment in ControlUp

There are loads of great admin features to make life managing the environment easier. One such killer feature, I love, is being able to select a user session and kill Group Policy being applied to that user, thus enabling the admin to change a browser setting, execute admin console, regedit or whatever is being restricted by GP.

Just one of the many built in features, there are far too many to write about in this blog, I suggest you go to their website and check it out for yourself.

As well as being able to use the built in features, Control-Up is extensible by creating your own Script Based Actions. These actions can be developed in house and/or shared with the community, there are already a large selection of scripts available to perform different tasks.

Its really quite easy to do, in fact I wrote my own. All that was involved was a slight modification to a PowerShell script I had previously developed. After some verifications and tweeking from Smart-X, it has now been published and shared for all to use, they even made a video showing how to use it.

Just one example of how admin and community oriented this product is, I urge you to download the demo and give it a try for yourselves. you’ll be supprised how great it is.


Monitor Citrix PVS ‘Cache In Ram’ Size Using Powershell

I’m a firm advocate of Provisioning Services ‘Cache in RAM with overflow on hard disk’ leveraging operating system RAM for write-cache. This results in better response times and a greater number of IOPS for the write-Cache than using traditional SAN or Local storage.

However, careful planning and monitoring of the size of this cache is imperative as a breach in the available RAM will cause an overflow to the assigned slower disk which dramatically reduces performance.

Much speculation has surrounded how to monitor the write-cache with some relying on the Target Device System Tray data but this only reflects the amount of physical cache used.

I wanted to be able to monitor the amount of Ram Used so that a typical usage baseline at a customer of mine could be taken.

Buried away in the Citrix eDocs (as most things are!) is reference to the actual metric that gives an indication of how much cache in Ram is in use. This can be done by checking the Pool Nonpaged Memory and is shown in the task manager.


In this case the Write-Cache is around 913MB minus some other elements, normally in my experience equate to under 100Mb.

To test this I copied 1Gb of files to the C Drive on the target device and the Nonpaged memory increased by 1Gb. What was interesting was that by removing the 1GB’s of data released the Nonpaged Memory, I wasn’t expecting that.

Using the task manager to check usage is not very practical, so I used WMI to provide the value and obtained this by writing a PowerShell function :-

Using this code we can get the values of multiple servers by using the pipeline eg:


Hope you find it useful and any improvements please add comments below.


Matthew Nichols

PVS Reseal with Appsense

Here is a script created to allow users to reseal a XenApp 6.5 server with Appsense Agent installed. It is meant to generalise the AppSense agent for imaging…

echo Removing AppSense CCA registry information and stopping CCA Service
net stop "AppSense Client Communications Agent"
reg add "HKEY_LOCAL_MACHINE\Software\AppSense Technologies\Communications Agent" /v "group id" /t reg_sz /d "" /f
reg add "HKEY_LOCAL_MACHINE\Software\AppSense Technologies\Communications Agent" /v "machine id" /t reg_sz /d "" /f

echo Starting the Citrix Reseal
"C:\Program Files (x86)\Citrix\XenApp\ServerConfig\XenAppConfigConsole.exe" /ExecutionMode:ImagePrep /RemoveCurrentServer:True /PrepMsmq:True
ECHO *************************************************
ECHO *************************************************
ECHO **************** RESEAL COMPLETE ****************
ECHO ***** Remember to promote the vDisk to Test *****
ECHO ********* The Server will now shutdown **********
ECHO *************************************************
ECHO *************************************************
shutdown -s -f -t 00

PVS Console Running Slow?

This is a very old fix but I keep seeing it when attending customer sites. The symptoms are PVS Console is very sluggish and you sometimes get the error :-

“The snap-in is not responding, end now or cancel to return to the MMC to check the status of the snap-in.”

By hitting Cancel the console loads but its very slow.


To fix it on Pvs 6 you should get this prompt….

Click Disable. However if you didn’t click it or choose something else you wont get prompted again.

The best way to fix this is to create a file called mmc.exe.config with the following contents…

<?xml version=”1.0″ encoding=”utf-8″?>
<generatePublisherEvidence enabled=”false” />


Copy this file to c:\windows\system32 and c:\windows\sysWOW64.


On restarting the console you should see the problem resolved;.