Automating Quarterly VDI “Unique Users” Reports with ControlUp Workflows and Custom SQL Queries
A common request in VDI environments is automating the generation and distribution of quarterly reports that include metrics such as "Unique Users" along with detailed user session data. One such use case involves producing an Excel (CSV/XLSX) report that captures the list of users who logged into the VDI environment during the previous quarter and sending it automatically to management via email.
ControlUp does not offer a direct, out-of-the-box report that automates this exact task with both unique user counts and full session data in one export, nor does it natively support emailing such reports on a quarterly schedule through the product UI alone. However, this requirement can be addressed using ControlUp’s extensibility and automation features, particularly by leveraging ControlUp Workflows and custom SQL queries within the ControlUp Insights platform.
One practical implementation involves creating a custom SQL query that extracts user session activity data—such as usernames and counts of sessions per user over the desired interval. This query can be run on a schedule aligned to quarters. The results are then exported into Excel format using the Microsoft Excel integration available within ControlUp Workflows. An automated workflow can then use the Microsoft Outlook integration to send the generated report via email to predefined recipients at the beginning of each quarter, with the data covering the previous quarter.
A useful example comes from a community user who adapted the "Device Inventory Report to Email" workflow template for their use case. They included a custom SQL query to capture user session activity over the last set number of days, generating a report of users and their session counts. This workflow creates a document (Excel file) and attaches it in an email sent automatically to recipients whose addresses are stored in a global variable, enabling easy customization of distribution lists. This approach requires the integrations of ControlUp for VDI, Microsoft Excel, and Microsoft Outlook to function smoothly.
While this method does not currently exist as a pre-built ControlUp dashboard or report that directly sends emails on a quarterly schedule, using the powerful combination of custom SQL queries, Workflows automation, and Office integration provides a viable and robust solution. For organizations that cannot utilize AI assistance due to policy restrictions, this approach offers a fully scriptable, controlled, and customizable method to achieve the quarterly "Unique Users" report and distribution goal without manual intervention.
ControlUp customers interested in implementing such solutions can explore the ControlUp Workflows feature, the SQL Query Editor in ControlUp Insights, and the email and Excel integrations detailed in the ControlUp documentation and the ControlUp Academy tutorials at https://academy.controlup.com. Additionally, the official workflow templates available in the ControlUp Console or downloadable from the ControlUp community can form a good starting point for customization. Read the entire article here...
