• 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

Automating a Reboot with Two Triggers in ControlUp

Posted on June 21, 2023

A user was looking for a way to reboot a server after an Event Viewer error had triggered maintenance mode and logged out all users. It was suggested to use two triggers – the first would put the server into maintenance mode and set a registry key, and the second would check the registry key and if it was present, reboot the server. The use of a PowerShell script was offered to create the registry key in the first trigger. To ensure that only servers with the 1005 error code were rebooted, the registry key would need to be checked.


Read the entire ‘Automating a Reboot with Two Triggers in ControlUp’ thread below:

Is there a way to incorporate a trigger to reboot a machine once another trigger has activated? For example, I want to reboot a machine after the first trigger detects an error in Event Viewer that places the server into maintenance mode and logoff all disconnected sessions. Then, once there are no users left, I want the server to reboot. Is that possible?


You can make the trigger based on an event log.. like.. if event log is found then… have the second triggers condition then check if there are no logged on users and verify that the server is in maintenance mode… it would be a bit of a mess though. You would need to verify a few different things in order for them to work after the other and not run on items you don’t want it to run

@member you have a better solution?


I have an Advanced trigger to reboot machines but I cannot add anything from Event Viewer from the Filter Editor in order to detect the error


2 steps should work:

trigger 1 : place in maintenance on event

trigger 2 : if maintenance mode and usersessions = 0 for > xx minutes run reboot script thatmight have some extra checks


Right – I just want to ensure the servers that are being rebooted also have the 1005 error code in Event Viewer

To avoid rebooting servers that just have maintenance mode on and 0 sessions


you could have the first one also set a registry key for example that the second one checks and clears in the script.

and only does the reboot with the key in place


oh good idea

How would I be able to do that with the first trigger?


https://devblogs.microsoft.com/scripting/use-powershell-to-easily-create-new-registry-keys/ in an SBA that runs on the target machine

Continue reading and comment on the thread ‘Automating a Reboot with Two Triggers in ControlUp’.  Not a member? Join Here!


Categories: All Archives, ControlUp Scripts & Triggers
Topics: Automation & Alerting, Logs, Microsoft, PowerShell, Scripts, Triggers

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..