Pawel Serwan Blog

Citrix, Microsoft and other stuff


[PowerShell] Generate report of your Citrix policies

CitrixPoliciesSome time ago I needed to create report of Citrix policies configured in my Citrix XenApp 6.5 farm. I thought I can simply do that using Citrix PowerShell commands. But it occurred that it is not so simple. Other requirement was to have the report created in Word format 🙂 So I started to write a simple script that in the end does what I needed: it lists your Citrix policies, checks their configuration and then generates a nice Word document. Below you can find the source code of the script. I hope you will like it and find it useful.

Continue reading

Leave a comment

4th PLCUG meeting review

30th of September has written into the history of Polish Citrix User Group (PLCUG). It was the biggest event ever and we hit the highest number of participants ever. We had a special guest from Kansas City – Jarian Gibson (CTP) who did his presentation. Read the whole meeting review here:

IV konferencja PLCUG – Podsumowanie spotkania

Special thanks to Andrew Wood and our colleagues from UK Citrix User Group. Thanks Andrew!


[PowerShell] Citrix StoreFront 3.x installation script

psRecently I was working on preparation of moving from Web Interface 5.4 to StoreFront 3.x. Installing few servers manually doesn’t make sense for me so I wrote a PowerShell script that automates whole installation process. Source code is available below. I hope you will like it. Continue reading


Citrix XenApp Monitoring Script

MonitoringMonitoring any infrastructure is demanding task. Despite the numerous monitoring tools available on the market I haven’t found yet the one that would allow to monitor Citrix XenApp farms completely. Not only by checking ping, free space and if IMA service is running. What if there is a problem with other services e.g. Citrix Print Manager service or other Citrix related that hanged and doesn’t allow users to launch their app? Even though you monitor that service you will not know about that.

That is why I was looking a way to check if Citrix XenApp is really accessible and allow users to launch applications. Recently I came across great article by Stan Czerno regarding his monitoring script. It is really good piece of work from him. However for some reasons the script was not working for me and I have changed it a bit. I had the problem with
$ICA.GetNotificationReason() which alwasy got back “EventNone” even if the application launched. That’s the reason I changed the way I check if the application is really launched or not. Additionally I’ve added a way to get all XenApp servers from the farm. Continue reading


First Look: XenApp/XenDesktop 7.6 – Part 9 (PowerShell)

Welcome in the last part of the First Look series on XenApp/XenDesktop 7.6. I made a long break since last post but luckily I found time to finish the series. Today I would like to focus on PowerShell in Citrix XenApp/XenDesktop 7.6. First let’s see what we did already:

In the first part – we have installed first Delivery Controller and setup our new XenDesktop 7.6 site.

In the second part – we have configured first site.

In the third part – we prepared the template image of Windows Server 2012 R2 that will be used by MCS service for creation of new machines that will be hosting user desktops and applications.

In the fourth part – we have upgraded XenApp 6.5 server to XenApp 7.6.

In the fifth part – we have created machine catalogs and used previously prepared master image. We attached to the site as well upgraded XenApp 6.5 server.

In the sixth part – we have delivered applications to the end users by creating delivery groups.

In the seventh part – we have configured StoreFront so that end users could launch their apps.

In the eighth part – we checked how Connection Leasing really works.

In the ninth part – I would like to show you how you can use PowerShell in XenApp/XenDesktop 7.6.

As you I hope already know PowerShell became the industry standard when it comes to the management framework, at least in Windows world 🙂 And well Citrix is part of that world of course. Good to see then that XenApp/XenDesktop provide an SDK based on a number of Microsoft Windows PowerShell version 3.0 snap-ins that allows you to perform the same tasks as you would with the Citrix Studio console, together with tasks you cannot do with Studio alone. To use SDK you need to just launch PowerShell console or PowerShell ISE if you would like to have PowerShell editor where you can write you scripts on your server with installed Citrix XenApp/XenDesktop 7.6. Continue reading

Leave a comment

CloudBusters: Episode 4 – Why my backup doesn’t work?

Obrazek Welcome in the 4th episode of Cloudbusters series. Today it’s Friday and as everyone knows on Friday the Moore’s law is even more possible to be proofed. During the last week I was deploying new environment in Windows Azure. Everything was smooth and easy till the last part – backup. Everyone loves backup, everyone knows how to do it, but not so many of us can really restore something from it if it is done poorly. Indeed, backup is important and due to that we decided to not relay only on the backup done by Microsoft (for sure you guys do the amazing job but Moore’s law is applying also here :)) . That is why we also implemented some easy way to do that with Powershell scripts. We use for that scheduled tasks and run the script created for specific environment. I wrote the same standard script and  did the configuration for my fresh new Azure deployment. The scheduled task showed that it finished successfully. Great!!! Happy to close the task and switch to something else I’ve decided to double check the log created during the backup job. And could you imagine my surprise when I opened the log file and saw the following entry:

Bacpac could not be exported. Exception calling “ExportBacpac” with “2” argument(s): “Could not export schema and data from database.” Continue reading