• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
ControlUp Community

ControlUp Community

Connect, Learn, and Grow

  • Blog
  • Podcast
  • Meetups
  • Archives
  • Categories
    • ControlUp One Platform
    • ControlUp for Apps
    • ControlUp for Compliance
    • ControlUp for Desktops
    • ControlUp Scripts & Triggers
    • ControlUp Synthetic Monitoring
    • ControlUp for VDI
  • Topics
  • Events
    • Logos & Wallpaper
    • ControlUp.com
  • Join

Finding App Launch Instances on Endpoints with ControlUp API

Posted on January 27, 2025

A user asked how to find the number of instances of an app launched on endpoints over a specific period of time. Another user provided a Powershell script that can be used to retrieve this information from the ControlUp API. The script can be modified to change the start and end date-times. The response also included a screenshot of the values for "citrix.desktopviewer.app.exe" for a demo tenant.


Read the entire ‘Finding App Launch Instances on Endpoints with ControlUp API’ thread below:

Good morning. I’m trying to find how many instances of an app is launched on endpoints (Citrix Workspace) over a specific period of time. I’m looking at the "Application Usage Statistics", but that appears to be showing all versions and doesn’t appear to be returning all of the records (24 records over the last 7 days). I just need a total count of how many times Workspace was launched over the last week but all endpoints. Is there a script that I should be looking at instead? Thank you in advance for the assistance.


I took Top Users By Application as a starting point. Taken the query to Powershell and replaced the cookie token with a API key header. Replaced acme.sip.controlup.com/ with api.controlup.com/edge/. Changed the maximum results from 15 to 5000. If you need more feel free to change the 5000 value to up to 60000. If you need more than that, let me know. We’ll have to take it offline.

Last but not least changed the grouping on username to _device_name.

“`$APIKey = "your API key here" ## see https://api.controlup.io/reference/how-to-create-api-keys#dex-platform-vdi–daas-and-edge-dx

$AllProtocols = [System.Net.SecurityProtocolType]’Ssl3,Tls,Tls11,Tls12′

[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols

$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession

$session.Headers["content-type"] = "application/json"

$session.Headers["accept"] = "/"

$session.Headers["authorization"] = "Bearer $APIKey"

$response = Invoke-RestMethod -UseBasicParsing -Uri "https://api.controlup.com/edge/api/dal/process_stops" `

-Method "POST" `

-WebSession $session `

-ContentType "application/json" `

-Body "{"data_query":{"size":0,"query":{"bool":{"should":[],"must":[{"range":{"stoptime":{"format":"strict_date_optional_time","gte":"2025-01-01T05:00:00.000Z","lte":"2026-01-01T04:59:59.000Z"}}},{"bool":{"should":[{"match_phrase_prefix":{"processname":"Citrix.DesktopViewer.App.exe"}},{"wildcard":{"processname":"Citrix.DesktopViewer.App.exe"}}]}},{"match":{"hasaforegroundwindow":{"query":true}}}],"must_not":[{"match_phrase":{"username":"NT AUTHORITY"}},{"match":{"ispartial":{"query":true}}}]}},"aggs":{"resultset1":{"terms":{"field":"_device_name.keyword","size":5000,"order":{"_count":"desc"}}},"proc_names_agg":{"terms":{"field":"processname.keyword"},"aggs":{"version_agg":{"terms":{"field":"processfileversion.keyword"}}}},"avg_avg_working_set_agg":{"avg":{"field":"averageworkingset_long"}},"max_peak_working_set_agg":{"max":{"field":"peakworkingset"}}}},"device_query":null,"export":false}"

$response.aggregations.resultset1.buckets | ogv“`

Oh I forgot to mention. The start/end date-times are hard coded. But you can modify that with Powershell as well

citrix.desktopviewer.app.exe values for my demo tenant


Amazing! Thank you so much. I’ll give this a shot shortly. Thank you for your time.

Continue reading and comment on the thread ‘Finding App Launch Instances on Endpoints with ControlUp API’.  Not a member? Join Here!


Categories: All Archives, ControlUp for Desktops, ControlUp Scripts & Triggers
Topics: Citrix, Citrix Workspace App, DaaS, Microsoft, Physical Desktops, PowerShell, Scripts, Security, SSL/TLS, VDI

Ask Us Anything, Connect, Learn, and Grow with the ControlUp Community!

Login to the ControlUp Community to ask us anything, stay up-to-date on what’s new and coming soon and meet other like-minded techies like you.

Not already a member? Join Today!

Primary Sidebar

ControlUp Academy

Enroll in ControlUp Academy for expert-led technical training, equipping you with skills to effectively deploy, manage, and grow your ControlUp investment.

Learn here >

Rotating Images

Hidden Gem from our Community on Slack!

ControlUp Betas - What's Coming Next?
NEW ControlUp Features - Stay Up-to-Date!
ControlUp Scripts - Scripting, Zero to Hero
Latest KB Articles - Be the First to Learn
Did you Know - with Sivan Kroitoru
Practical Perspectives Technical Use Case Training

Video Tutorials Library

Visit our technical how-to videos, offering step-by-step tutorials on advanced features, troubleshooting, and best practices.

Watch here >

ControlUp Blog

Check out the ControlUp blog for expert advice and in-depth analysis.

Read here >

ControlUp Script Library

Visit the ControlUp technical script library, which offers a multitude of pre-built scripts and custom actions for your monitoring and troubleshooting requirements.

See here >

ControlUp Support

Visit the ControlUp support home and to delve deeper into ControlUp solutions.

Browse here >

Download ControlUp RealTime DX

Start with ControlUp for real-time end-user environment insights, swift troubleshooting, and unprecedented performance optimization. Download now.

Download here >

Footer

      

ControlUp Community
Of Techie, By Techie, For Techie!

Terms of Use | Privacy Policy | Security
Dive Deeper, Learn more at ControlUp.com

  • facebook
  • twitter
  • youtube
  • linkedin

© 2023–2025 ControlUp Technologies LTD, All Rights Reserved.

We use cookies to ensure that we give you the best experience on our website. by continuing to use this site you agree to our Cookie policy..