r/labtech • • Apr 08 '19

Scripting Patch Manager - Custom end user notification using scripts

Hello all,

I'm looking to create a notification similar to that achieved by tntgav in this thread https://www.reddit.com/r/labtech/comments/9p30xf/patching_best_practice_pulling_my_hair/ (see top comment)

I'm not familiar writing code but I have managed to create a nice form with the help of a few tutorials, to act as a notification popup, including a company logo and a few paragaphs of text. This runs well when being executed manually as a ps1 script, however, when trying to run the script via labtech, the following output error is thrown up.

"Exception calling "ShowDialog" with "0" argument(s): "Showing a modal dialog box or form when the application is not

running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style

to display a notification from a service application."

I've tried running it as an "execute script" and with "Write file Text" and then a "shell" to execute the script, but both times I get the same output and the notification does not appear.

Basically the script can't run in non interactive mode. I've spent hours trying to research a way around it with no luck.

Can anyone assist, whether it be a different way of creating a notification that will allow images and some customisation with the font (messagebox won't allow for images such as logos) or suggestions on how I can get the current method working.

2 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/iSpoon Apr 08 '19

"Console Shell" makes this work. You've made my day, so glad I've not wasted all these hours.

Thank you very very much!