• 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

How to Run System-Based and User-Based Scripts in ControlUp

Posted on November 25, 2025

A discussion about running a script in the user context of the currently logged on user, but triggered by a system event. Suggestions were made to use system-based and user-based scripts, with an example of setting and clearing tags using registry values. The issue of user/administrative permissions was discussed.


Read the entire ‘How to Run System-Based and User-Based Scripts in ControlUp’ thread below:

Is there a way to run a script in the user context of the currently logged on user, but triggered by a system event? Whenever I do event log triggers, it is only giving me access to machine based scripts


not really possible as it might be a multi user system so how would it know which user to target


This is a single system VDI so was hoping since there is a 1:1 mapping it’d be possible


you could make it a 2-stepper: a system based sba that sets a specific tag for sessions and a user based one that responds to that (and clear the tag)


do you have an example?


not immediately maybe @member has something


In your computer script

[microsoft.win32.registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Smart-X\ControlUp\Agent\SessionTags", "SomeUniqueKey", "SomeUniqueValue")

Then create a session trigger and attach another script action. The script action does whatever you need it to do and clear the tags. You can clear the tags using:

“`$RegKeyPath = "HKLM:\SOFTWARE\Smart-X\ControlUp\Agent\ComputerTags"

Remove-Item -Path $RegKeyPath -Recurse -Force“`

Do note that to be able to clear tags the user needs to be an administrator. As the tags are stored in HKLM

Alternatively you can also consider invoke-cuaction.


The issue is around the user not being an admin. We are trying to catch if the user is trying to elevate a process with admin credentials so the user is a standard user by default


Are the machines persistent? If not, not being able to delete the tag might not be the worst


mixture of both

If there was a way to do a user context script based on an event ID I’d have everything I need

Continue reading and comment on the thread ‘How to Run System-Based and User-Based Scripts in ControlUp’.  Not a member? Join Here!


Categories: All Archives, ControlUp Scripts & Triggers
Topics: Automation & Alerting, ControlUp Agent, Credentials, Logs, Microsoft, Scripts, Triggers, 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..