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

ControlUp Community

Connect, Learn, and Grow

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

How to Create Toast Notifications in CU VDI using PowerShell and ControlUp

Posted on September 8, 2025

A user is asking for help writing a trigger in CU VDI that alerts users to clean up their D drive. Another user suggests using PowerShell with BurntToast to create toast notifications, but notes that it must be run in the user’s session. They provide several methods for doing so, including running in each user’s session and creating a scheduled task. Another user suggests writing a script that runs on the monitor instead of the target machine and uses Invoke-CUQuery and Invoke-CUAction to get information and run the toast notification script on the user’s session. They note that there are some nuances that need to be figured out and suggest using Get-CUAvailableActions to get the action ID of the toast script. A working example is requested.


Read the entire ‘How to Create Toast Notifications in CU VDI using PowerShell and ControlUp’ thread below:

I’m trying to write a trigger in CU VDI that alerts the user with a toast to clean up their D drive when their D drive disk space drops to

Anyone know a way to pull this off?


before joining Controlup a had a member of me team do something similar and he had use task scheduler. I put the details into chat GTP and if i remeber it is along the lines of what he did .

  1. Use PowerShell with BurntToast (per-user session)

BurntToast

is a PowerShell module for creating toast notifications.

Example script to show a toast:

“`

Import-Module BurntToast

New-BurntToastNotification -Text "Hello!", "This is a test notification."“`

⚠️ Must run in the user’s session.

If you run this from SYSTEM or via a scheduled task without session context, the user won’t see it.

  1. Run in each user’s session using psexec or Invoke-Command

You can inject into a user session with Sysinternals PsExec:

“`

psexec.exe -i powershell.exe -ExecutionPolicy Bypass -Command "Import-Module BurntToast; New-BurntToastNotification -Text ‘Server Notice’, ‘Updates will be applied at 6 PM’"“`

• -i <SessionID> tells PsExec to run interactively in that user’s session.

• Find session IDs with:

“`

quser“`

  1. Scheduled Task (best for multi-session servers)

Create a scheduled task that runs in the user context and triggers immediately. This guarantees the notification runs inside their session:

“`

$Action = New-ScheduledTaskAction -Execute "PowerShell.exe" -Argument "Import-Module BurntToast; New-BurntToastNotification -Text ‘Reminder’,’System maintenance tonight at 10 PM’"

$Trigger = New-ScheduledTaskTrigger -AtLogOn

Register-ScheduledTask -Action $Action -Trigger $Trigger -TaskName "ShowToast" -User "DOMAIN\username" -RunLevel Limited -Force

Start-ScheduledTask -TaskName "ShowToast"“`

Then you can delete it if you only need it once.

  1. For all active sessions (looping)

To broadcast to all logged-on users:

“`

$queryResults = quser | Select-String "Active"

foreach ($result in $queryResults) {

$sessionId = ($result -split ‘\s+’)[2]

psexec -i $sessionId powershell.exe -Command "Import-Module BurntToast; New-BurntToastNotification -Text ‘Notice’, ‘Server reboot at 6 PM’"

}“`

✅ Key point: Toasts require the user’s context (explorer.exe running). SYSTEM or admin-only execution won’t display to the user. That’s why PsExec -i or scheduled tasks per-user are the usual solutions.

we used to do session recording in a session and push a notification to the user to warm them and also some survey stuff (before the time and CU sentiment)


just have my phone so bear with me.

  1. write a script that uses the execution context in the console set to “console/monitor” instead of target machine.
  2. This will cause the trigger to run the script on the monitor that is assigned to the machine that owns the disk.
  3. on the arguments tab, ensure that the machine name is passed along as argument 0 using a record property argument.
  4. Use invoke-cuquery -table Sessions -where “sServerName = ‘$($args[0])’”
  5. Take the objectguid or key from step 4 and pass it to:
  6. Invoke-cuaction -actionId IDOfYourToastScript -RecordsGuids KeysOrObjectGuidsFromStep4
  7. Maybe pass some arguments if needed.

Basically:

• run a script on the monitor instead

• Script asks the in memory database for all user sessions running on the machine which actually has the disk filling up

• Script then asks the monitor to run a different action (script) against the actual user sessions using invoke-cuaction

There’s a few nuances you’ll need to wait until I get to a computer. Or try and figure out.

• using get-cuavailableactions to get the action ID of the toast script

• The filter for actual user accounts (step 4 as currently written will include the console and service session that every modern system has)

• Some other details like other required cmdlet parameters.

But the above concept will work.


Good stuff @member !

If you can share a working example it would be great

Continue reading and comment on the thread ‘How to Create Toast Notifications in CU VDI using PowerShell and ControlUp’.  Not a member? Join Here!


Categories: All Archives, ControlUp Scripts & Triggers
Topics: Automation & Alerting, Databases, PowerShell, 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

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

Browse 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–2026 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..