Posted in Scripts

Citrix XenApp Server Monitoring Script / Citrix Server HealthCheck Script

I would like to share the Citrix XenApp Server Monitoring Script  / Citrix Server Health Check Script which is created by me with the bits and pieces of scripts which i found in Google and some useful blogs.

Being an administrator, you need to check the status of Citrix server. Logging into the server and checking the details is a hectic process. What if you could sit and relax and if any issues, you receive an email in your inbox. Wonderful!… Right?

The main advantage of this script is that you will get a beautiful report in your inbox which helps you to identify the issues in your Citrix Environment in short. It is easy to implement the script by non-scripting people too.


Why my script? For Better presentation and logging. Simple and understandable Email reporting.


What is the requirement?

1. Need to have the Power Shell V2 installed on one server [Prefer ZDC]. [Note: You may need to install the Power Shell on all your legacy servers if the script does not function as expected]

2. Need to have the XenApp Commands Tools / SDK Installed on this server.

3. Power Shell Remote Execution Policy to be enabled.

4. Make sure that you have any Power Shell Editors installed on this machine [PowerShell ISE, PowerGUI Script Editor, etc]


What you have to do?

1. Download the script from the site [If no download link available, email to]

2. Copy the script into a directory on your ZDC / The server which you prefer.

3. Open the script with the Editors and fill the missing parameters based on your Customer Environment.


4. Once you complete with the required details, please save the script and execute the script using PowerShell.

5. Wait and watch what is going on… Hurray!… It is an awesome simple report in your mailbox or in the PowerShell console.


What are the advantages or what does this script checks?

1. You have not required to provide any server list or names. The script will automatically pulls the servers names from the Citrix Farm using ZDC.

2. It can easily adapt or implement on any Citrix XenApp 4.5 / 5 / 6 / 6.5 Environments with Windows 2003 / 2008.

3. The script checks the below parameters on the Citrix servers and report to you the status.

##   – Ping response of the Server.

##   – Citrix Logon setting status.

##   – ICA Active Sessions on the server.

##   – ICA Disconnected Sessions on the server.

##   – Citrix License Usage on the License Server.

##   – Assigned Load Evaluator to the Citrix server.

##   – Citrix Server Load.

##   – RDP port response.

##   – ICA port response which identifies the Listener down status also.

##   – CGP port response (session reliability).

##   – CPU Usage of the server.

##   – Memory Usage of the server.

##   – Citrix Related Services (IMA, Print Spooler, Citrix Print, WMI, XML).

##   – Server uptime (to ensure scheduled reboots are occurring).

##   – Server folder path and worker group memberships.

##   – Applications published on the server.


Here is the awaited Results… The wait time is over… Grab it at the earliest…


1. You can schedule to run this PowerShell script using the Scheduled Task if you want to run it periodically. If you are running the script manually, you will find the below screen in PowerShell console.

2. At the end of execution of the script, you will get the result as shown below in your PowerShell console.


3. You do not have time to login to the Server and check the Console result everytime and you need an email report. Below are the screenshot, how your email report looks like…



4. Also the email which you will receive has an attachment which contains the detailed log file for your detailed reference.


Hope i was able to contribute to reduce your human effort in checking the Health of the Citrix XenApp Servers.

If you find this script useful for you, please donate to assist you more 🙂


Script Download


CreditsJason Poyner [He is the real hero behind the HTML reporting codes]. Ref:



Citrix Technical Expert interested to learn new technologies and all the tips and tweaks of Citrix Products.... Interested to Automate the manual tasks...

60 thoughts on “Citrix XenApp Server Monitoring Script / Citrix Server HealthCheck Script

  1. Nice script and its very usefull, Moreover steps are very clear to understand everyone and enjoy the technologies.

  2. Simple and less effort. Thanks for the good work and chat support provided for making this script to work.

  3. Dude… I was glad to see the script. . Which is neatly explained and segregated into functions. I scheduled this script after some tuning in my environment for every day. It is taking around 30 min to complete the report and send. Its been over a week and I am still thinking what is missing in this report :D.

    Great work and wonderful job Gins. Proud of you boy.


    1. Not able get the image in the report.
    2. Sometimes, different zone servers are reported as not ping able. No consistency in that. Not the same servers. When I ran report from server in 1 zone and issue is faced for other zones … not sure of it.

    1. Yes, i will add that as a separate one for the provisioned xenapp server health check :-). This is very generic to do a health check for the XenApp servers irrespective of physical or virtual or streamed

  4. First of all, thanks a ton for this wonderful script and I’ve deployed this for multiple customers. However, I have something that I’m unable to sort it out. Everything on the report mail comes fine for all customers only the License part always shows “Citrix License Usage: Error; Check Detailed Logs”. So, need your help here to resolve this issue.

      1. Hi Ginsmon, Thanks a lot for this wonderful script. Have you found the fix to License issue ? We also getting the same.

      2. I found the cause for the same. Working towards the fix. I could not focus last few months due to my personal reasons. I will try to make my blog active sooner.

      1. I have powershell v2 installed on the 2k3 servers.. Still the script doesn’t work on 4.5 environment.. However works great for 6.5.. License details are still missing.. Any help is greatly appreciated

      2. Dear Rajeev,
        I was offline due to busy professional challenges. My apologies for the late reply. Do you still run the same environment or you want to look into the current state now?

    1. It is because the WMI query does not return the values correctly. Other possibilities i may need to troubleshoot at your environment level. Is all your servers are W2k8? Mostly i see this problem with W2k3 hosts only

  5. Just wanted to say Great job on this script and keep up the good work. I hope to see something similar in the future that would check the health of the entire citrix stack…7.6 XA/XD, PVS, NS, and even XenMobile. That would be something I would gladly pay for.

  6. My company is a citrix platinum partner and we have expert engineers in nearly anything citrix or related. We do have a test environment and I can guarantee many of our engineers would be happy to help you test. Hit me up offline and we can discuss.

      1. Not a problem. Grab my email address from my account info and we can setup a time to chat over the phone/email and discuss this when you get back.

    1. are you not able to find the download link on my blog? I have provided the download link at the bottom of the same blog. If you still can not, give me your email id an i will provide you the script

  7. You are Rock Star !! this was with me but not as consolidated as you presented here. Thank you so much and all the fame and accolade I will get by using this is truly yours !!

  8. Hi Gins…I know u dnt need more comments of appreation from my end for this awsome work… coz U already had enough!!! 😉 … good to know that its moving arround well and gettting more features added to it as a result in parallel… keep us posted on your updates on the same and will defenitly reach you out offline…all the very best my dear mate…great go!!!

  9. Hi Gins..I am sure u dnt need more comments of appretiation from my end on this great job coz u already had enough!!! 😉 Good to know that it goes well arround and thus getting more features added to it in result… I may need your help on some specific topics in it and in general…will reach you offline to have it…
    I am sure ur dedication will defenitly keep this blog active… All the very best dear mate…Great goo..!!!

  10. Hi Dear…I know you don’t actually need a comment of appreciation from my end on this wonderfull job…coz u had enough already…lol!!! Its gud to see it goes well arround n thus getting updates added to it in result…I may need your help on this stuff specifically on some topics n will reach u offline…keep up the gud work as always mate…you have my best wishes….gr8 goo…!!!

    1. This would be very interesting for me, too!
      What is to be done to make it work with a 4.5 farm?

      1. You need to install the powershell on the server and install the xenapp remoting commands tools from citrix to work on a 4.5 farm. if not, we have a VBS script for the 4.5 farm

      2. Thank you for answering, but I’ve already done it myself! Very nice script, though I’ve made some “customizing”…

  11. Hi Ginsmon,

    Thanks a lot for this wonderful script. i need your help and guidance to develop monitoring for Citrix XenApp 6.5 & 7.6.

    Please let me know the email address to reach you for further discussion.

  12. Please suggest, how to rerun a script post remediation… what if i have to run a report on failed or remediated servers…

    1. As of now, the script is not intelligent to perform the same. However a new version of script which can read server names from text file for Health Check is in progress. That should help you to test only few servers with a manual input of the server names.

  13. Any suggestion, to rerun a script for failed servers…. instead of running the entire script post remediation.

  14. Hey Ginsmon,
    i tried the script but i want to know how to make it dump a csv file to be like this,


  15. Hi Joseph, first of all thank you for this script. It’s really appreciated the effort you have put into this. That being said, is there a possibility to have the available disk space show up in the table?

      1. Hi Joseph, did you get a chance to include Disk space parameter… waiting for the new script.

  16. Hi Gins,This is Pandiyan (HP). Hopefully you could remember :). Do you have a script for Xendesktop 7.6?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.