It’s Time for Automation – Part 3

NOTE: This post comes from Oleg Alter, a Senior Product Manager at ControlUp.

I was thrilled to learn that since my first It’s Time for Automation blog post, thousands of Automated Actions are in flight in our customers’ environments. Many of those Actions optimize VDI resources and reduce bandwidth by closing unused remote sessions and setting resource usage priorities based on the business’ actual needs. If you use our automation for resource optimization and observe positive changes in your environment, I would love to hear about it! Have you noticed any change in your environment resource availability since you activated ControlUp Automation? Have you increased your number of concurrent sessions? Let me know!  

Since my last blog post, more than one hundred new scripts have been submitted to ControlUp by our great community. Many thanks to everyone who has submitted a script. Our team reviews every one, and many submissions have been published back to the community. If you submitted a script and were contacted by one of our domain experts, it means that we love your idea, want to publish your script, and need your permission to edit your script to make it as robust and readable as possible. If you’ve been contacted and haven’t replied to the domain expert, please do!

ControlUp Automation: Keep those scripts coming
Keep those scripts coming!

Finally, if you haven’t tried our automation yet, what’s stopping you? We’d love to know. Your candid feedback will help us keep improving.

If you’re not familiar with how to use Community Triggers for Automation, here are some related blog posts:

You can also watch this video on how to create Automated Actions.

In today’s It’s Time for Automation installment, I’ll share some of new scripts released by our community and domain experts. For new scripts, I will also discuss the use cases these scripts best apply to and suggest ways to automate them. For some scripts, we’ve also added Action Recommendations from our Virtual Expert to make your life easier when troubleshooting, operating and analyzing your environment health.

New – Community Triggers

Note that we have added a new element to the It’s Time for Automation series! In addition to Automated Actions, we’re also developing Community Triggers to further simplify the introduction of Automation to your environment. After testing, we’ll publish the Predefined Automation triggers so all you need to do is tweak that trigger for your environment rather than create it from scratch. The recently published triggers are described below with the associated published Action.

New Scripts

Reduce Session Bandwidth Consumption
Written by: Marcel Calef
Reviewed and Approved by: Ricky Trigalo

In a previous post I covered several scripts which deal with computer session resource optimization. This script shows how you can optimize the network bandwidth a user session consumes, reducing users’ abuse of your network. Marcel’s script Reduce Session Bandwidth Consumption reduces the actual session bandwidth by setting the Frames per Second and reducing the session Visual and Sound Quality to a level determined by the admin. A single script applies to both Citrix HDX and VMware Horizon technologies.

Using Marcel’s script, if the user’s session’s available bandwidth reaches the low threshold set by the admin, and latency is higher than normal, the script will limit the visual and audio quality to make up for the lack of network resources. Some Citrix admins may say that Citrix Session Policies deals with aspects of bandwidth limits, but when interviewing Marcel as part of the script review process, I learned that the applied Citrix Policy won’t change in the course of a session, just during reconnections. This script will react to the session’s bandwidth.

Our Virtual Expert will recommend that you execute the script when the combination of session bandwidth and latency reaches a specific threshold. You can either use our recommendation and trigger the script on-demand, or you can automate it by enabling AAS_Reduce Session Bandwidth Consumption.

Reduce Session Bandwidth Consumption

The combination of low available network bandwidth and high latency is a sign that a network can’t cope with high-quality graphics and audio traffic, with the resulting ‘jitter’ affecting productivity and negatively impacting your business. With our automation platform, you can apply the script to some users, while for others you won’t. For example, if your marketing team uses media creation applications for business, you won’t want to reduce their video or audio quality. But, for other employees, the combination of high network bandwidth and high latency may be a sign that they are watching YouTube or checking Facebook rather than focusing on work tasks, so you can reduce their sessions’ visual and audio quality without compromising business needs. How cool is that?

Disable or Enable Citrix Published Applications
Written by: Guy Leech
Reviewed and Approved by: Trentent Tye

Security-conscious customers may only want certain applications to be launched during business hours.  After hours, those published apps should be disabled and/or hidden from view. This idea and script came from our well known Citrix expert, Guy Leech. Guy’s script will help you enable or disable any business application. You can fire the script on-demand by clicking on the application name from the ControlUp Console → Machine View and specify the Business Application you wish to publish or unpublish. Note that the script needs to run on a delivery controller or somewhere where Studio is installed.

Run Citrix ADC HA Healthcheck
Written by Esther Barthel
Reviewed and Approved by: Trentent Tye

This Script Action runs a health sanity check on Citrix ADCs to ensure high availability of the associated node and alerts the Citrix admin for vulnerability risks. If you are interested in the ADC metrics HA Current Node State, HA System State, and HA Sync, we recommend that you use this script. Esther originally wrote about this use case in her blog post Making Citrix ADC High Availability Health Checks Easier. Esther subsequently created this script, and we built the associated Virtual Expert Recommendations and Automation Triggers.

Run Citrix ADC HA Healthcheck

MS Patch Check for Citrix
Written by Zeev Eisenberg
Reviewed and Approved by: Esther Barthel

This script will check the target computer for the presence  of the Microsoft patches Citrix recommends be installed in order to optimize the machine for Citrix XenDesktop and XenApp. The ControlUp Virtual Expert will recommend that you run this script when a computer has been running for more than 15 days. You’ll get this new recommendation when you Click on UpTime metric.

You can either run the script on-demand or enable  ControlUp Automation machine-based trigger AAC_Uptime in days – MS Patch Check. To execute the Automation Trigger, following Microsoft Patch Tuesday policy, on the third or fourth Tuesday of the month, run the script on Win Server machines when Up Time in Days >15 and OS is Win Servers 2012.

MS Patch Check for Citrix

Cleanup Windows System Drive
Written by Ton de Vreede
Reviewed and Approved by: Oleg Alter

This script is used to clean up a disk by deleting the contents of directories which are known to accumulate large amounts of useless data.

By default, the following folders are emptied of these files (if they exist):

  • %systemroot%Downloaded Program Files
  • %systemroot%Temp
  • %systemdrive%Windows.old
  • %systemdrive%Temp
  • %systemdrive%MSOCacheAll Users
  • %allusersprofile%AdobeSetup
  • %allusersprofile%MicrosoftWindows DefenderDefinition
  • %allusersprofile%MicrosoftWindows DefenderScans
  • %allusersprofile%MicrosoftWindowsWER

Additionally, the files %SystemRoot%memory.dmp and %SystemRoot%Minidump.dmp will be marked for deletion and removed by the script, when they exist.

If you enjoy driving your environment in Cruise-Control mode, a Community Automation Trigger is available for you. By enabling the Automation, if the machine’s system drive has less than 600 MB free space, ControlUp Automation will trigger and run Cleanup System Drive script to free your system drive by deleting the contents of the directories described above and are known to accumulate large amounts of useless data.

Cleanup Windows System Drive

You can enable the Trigger and use our Out-of-the-Box Automation or feel free to edit and fit it for your environment needs.

WMI Cleanup  
Written by: Michael Albert
Reviewed and Approved by: Guy Leech

The script checks, fixes and repairs Windows Management Instrumentation (WMI). We recommend using this script when the WMI repository is corrupt or not working properly. It re-registers the following binaries — “unsecapp.exe”, “wmiadap.exe”, “wmiapsrv.exe”, “wmiprvse.exe”, “scrcons.exe” — then runs winmgmt /resetrepository, followed by winmgmt /salvagerepository

Check Ivanti Workspace Control DB Cache folder size and transaction logs
Written by: Chris Twiest
Reviewed and Approved by: Ton de Vreede

Using this script, Ivanti customers can check the size of the DB Cache folder and see if the Transaction folder contains transaction logs.

Disable or Enable SSH on VMware ESXi Host 
Written by: Marcel Calef
Reviewed and Approved by: Ricky Trigalo

This script allows you to enable or disable SSH on vSphere Hosts, so the user can make hypervisor or HW-related changes.

Check Citrix User Device License Usage
Written by: Marcel Calef
Reviewed and Approved by: Dennis Geerlings

The script uses udadmin.exe and displays the license(s) checked out for the selected username and/or client device. Note that the script is required to run on the Citrix License Server.

WARNING: avoid running the script against multiple sessions simultaneously to prevent significant resource consumption on the Citrix license server.

Process CPU Usage Limit
Written by: Guy Leech
Reviewed and Approved by: Ricky Trigalo

The script finds threads over-consuming CPU in the selected process and reduces their average CPU consumption based on the aggressiveness argument. The higher the aggressiveness, the more CPU throttling is performed. The number can be between 1 and 10 including decimal places.

Set AuthRoot Registry Permission
Written by: Drew Robins
Reviewed and Approved by: Dennis Geerlings

This script will set the correct permissions on
to fix CAPI event id 4110 by allowing NT SERVICECryptSvc full control on the
HKLMSOFTWAREMicrosoftSystemCertificatesAuthRoot registry key and its children.

That’s it for today! But stay tuned, and watch for an upcoming blog post covering how using ControlUp Automation can optimize your process compute consumption, and how you can automate, backup, and restore your ADC configuration files.