Using App-V 5 with Citrix PVS and pre-staging registry (PowerShell and Tool)
Recently while working at a customer I was tasked with creating a solution to make sure that when users login to their Citrix sessions the App-V applications are synced and the registry is staged. For the users Citrix sessions provisioned XenApp servers are used. This means that after every reboot the PVS cache will be emptied and the system drive will again be as it was when created or sealed. To make sure App-V 5 works correctly and has the best performance with a provisioned server we have to do the following steps:
- Import the APP-V 5 ADMX files and use that to configure your App-V clients.
- Enable App-V shared content store mode. This will make sure that not all the data from the App-V packages is loaded to the harddrive. Which will be a waste since all data going to the system drive on a provisioned server will end up in its Cache. Instead shared content store will create links in your default content path to the data and if the data is needed it will load it in the RAM which makes for fast applications. You could change the default content path from c:\ProgramData\App-v to a persistent disk but this can result in issues because the data will already be there while the App-V client won’t know it is when the provisioned servers are rebooted.
- Use the App-V 5 publishing server, this will make publishing the packages a lot easier because it can be done on machine accounts. I would recommend creating a Security group with your PVS servers machine accounts in it to publish the applications. But make sure that your template machine is not part of this group.
- Create or Seal your PVS image (vDisk) without App-V packages published in it. You can achieve this in two ways. One; you can make sure that the server on which you created the image or sealed the disk is not part of the publish group like stated in the last point. Or two; you can run the following PowerShell command before sealing the image (vDisk):
To make sure the App-V applications are synced and the registry is staged before users can logon to the server and use the applications, I have written a PowerShell script that will do the following:
- It will stop the Citrix Broker Agent, this way the server is Unregistered in Citrix Studio and users are not able to logon.
- It will sync all Packages that are available to the server. It will get these packages from publishing server 1, you can change this if needed.
- It will open a CMD in the bubble and check when the registry is staged. When it is it will stop the CMD.
- After that it will start the Citrix Broker Agent, this will Register the server in Citrix Studio and users will be able to logon.
This script is best run at system start-up. To create a start-up task you can use the following PowerShell script:
Or you can use this Tool that I created:
When clicking on “Sync and Stage Now” the Citrix Broker Agent won’t be stopped ! But the created task will stop the Broker Agent while syncing. Tool only works with Publishing Server 1.
I hope this was informative. For questions or comments you can always give a reaction in the comment section or contact me:
Very nice, I’m curious as I am struggling with some pieces of this same puzzle
We are running mandatory profiles with our PVS and we are trying to get the initial appv load from running each time a user runs an appv app. With the mandatory profile being deleted after logoff the appv app loads each time the user tries to run it. We are trying to get the appv app to preload for the user so it will launch much faster for them. We do run a command to get the appv apps at startup of the target server, but it seems to not make a difference when the user runs the appv package with storefront.
Thank you,