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

Disable Secure Boot on Windows 2012 R2 to install the Citrix VDA – CTX137731

I recently attempted to install the Citrix VDA on a Windows 2012 R2 RDSH server running on Hyper-V 2012 R2 and received the following error …


“ The Virtual Delivery Agent (VDA) does not support Secure Boot, which is currently enabled. “


So I searched for Article CTX137731 as described but it doesn’t exist.

After some investigation it appears that when using Hyper-V 2012 R2 if you create a VM using a Generation 2 Virtual Machine, Hyper-V enables Secure Boot by default as described here


To disable this feature you need to power down the VM and then use the following PowerShell command on the Hypervisor…


Set-VMFirmware –Vmname <VM_NAME> –EnableSecureBoot Off


Hope this helps someone else.

Matthew Nichols