• 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

Fixing an Issue with Outputting Scheduled Tasks Trigger Info

Posted on February 2, 2023

A user encountered an issue when running a script for pulling in a scheduled tasks trigger info. The output created an index that was empty and when clicked it showed a blank page. With the help of @member, they were able to create a script that would output details from the Trigger including StartBoundary, DaysOfWeek, WeeksInterval, DaysInterval, and NextRunTime. It was suggested that specific values may have been an issue with the output, but it was not concluded.


Read the entire ‘Fixing an Issue with Outputting Scheduled Tasks Trigger Info’ thread below:

Running into an issue w/ a script that is pulling in a scheduled tasks trigger info. If i run it locally it works ok and pushing in in Edge DX does not appear to throw any errors. It creates the index but empty data and when you click on the index its a blank page.


“`Write-Output("### SIP DATA BEGINS ###")

Get-ScheduledTask -TaskName "HP BIOS Updates" | Select-Object -ExpandProperty Triggers | ConvertTo-Json

Write-Output("### SIP DATA ENDS ###") “`Maybe there are invalid characters in the output that JSON is not happy with? And I assume you’ve left the line that sets system encoding in the script?

Sidenote, personally I like to define the return outside the ‘SIP DATA’ part, just to make sure I never mess it up. Something like this:

“`$return = Get-ScheduledTask -TaskName "HP BIOS Updates" | Select-Object -ExpandProperty Triggers | ConvertTo-Json

Write-Output("### SIP DATA BEGINS ###")

$return

Write-Output("### SIP DATA ENDS ###") “`


But that is just me being paranoid as well 😉i do have the encoding part in there yes but good point to remember. i’ll try your code quick to test


ok your version it didnt like BUT using my original ran but eventually gave this error: Some items failed to upload. RunScriptFileAsSystem error during POST Json output: {"items_sent":1,"created":0,"failed":1,"uid":"bef1a15c87e84045af09e4f4143f6da2"}Not sure why $return did not work. I usually actually do ‘Write-Output -InputObject $return’ but again that is being a tad OCD. Either way, that is not the issue you are trying to solve.

I ran your code for the Adobe Update Task, there is a lot of nested data in that Trigger (disclaimer: I don’t know if your HP BIOS Updates" is the same type of trigger). Maybe get that object with the Trigger without converting it to details, then create a hashtable with the specific data you would like to see recorded (a lot in my trigger data is useless) and output that table while converting it to JSON.


thanks for the troubleshooting here! do you have a tweaked version of the code i can mess with by chance?


If the info is not sensitive, send me the output of your script in a DM and what properties you would like to see recorded, I can take a shot.


awesome thanks for the help!


Always wait with thx until yer sure I’ve not blown up yer computer 😉


haha thats fair


for anyone interested, this is the working script w/ the help of @member!“`[pscustomobject]$objTask = Get-ScheduledTask -TaskName "TaskName"

Create hashtable for output, use Get-ScheduledTaskInfo to get next run time

[hashtable]$hshReturn = @{

‘StartBoundary’ = $objTask.Triggers.StartBoundary

‘DaysOfWeek’= $objTask.Triggers.DaysOfWeek

‘WeeksInterval’ = $objTask.Triggers.WeeksInterval

‘DaysInterval’ = $objTask.Triggers.DaysInterval

‘NextRunTime’ = ($objTask | Get-ScheduledTaskInfo).NextRunTime.ToString()

}

Write dem deets

Write-Output("### SIP DATA BEGINS ###")

Write-Output -InputObject $hshReturn | ConvertTo-Json

Write-Output("### SIP DATA ENDS ###")“`so that script works nicely…..however the index and report built off of it is a bit strange w/ the columns (i added enabled to the above script to show that as well) . notice the up/down buttons on some columns and enabled does not have a filter box at all


I don’t think that is related to your script though, may one of the Edge experts can explain why it works this way.


That’s what I was thinking…. Something with those specific values maybe. Not a huge deal but just odd so thought I’d mention

Continue reading and comment on the thread ‘Fixing an Issue with Outputting Scheduled Tasks Trigger Info’.  Not a member? Join Here!


Categories: All Archives, ControlUp for Desktops, ControlUp Scripts & Triggers
Topics: Automation & Alerting, BIOS, ControlUp Solve, HP, Physical Desktops, Reporting, 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..