Skip to main content

I am writing a PS worklet to prompt the user to close Outlook to allow the install of the Mimecast for Outlook plugin. I would like to not go down the road of creating a scheduled task to perform this action. 

I have tried a couple different options:

Send-ActiveUserMessage -Title 'Close Outlook' -Message 'Outlook will close automatically in 1 minute for the Mimecast plugin Install. Please wait 5 mins before opening Outlook again. Thanks, IT.' DialogType 'OK' -Timeout 60

&

# Add required assembly for MessageBox
Add-Type -AssemblyName "System.Windows.Forms"

# Show MessageBox that Outlook is closing
>System.Windows.Forms.MessageBox]::Show('Outlook will close automatically in 1 minute for the Mimecast plugin Install. Please wait 5 mins before opening Outlook again. Thanks, IT.','Close Outlook','OK','Warning')

 

Neither seem to display an interactive message for the user but work in ISE. I read in a previous post here that this was due to the worklet being run as system user and that makes sense, but an AutoMox employee mention the Send-ActiveUserMessage as an option.

Has anyone had success here and can share what they used?

Hi there,

One of my colleagues referred me to the following worklet, it contains base code suggestions also utilizing the Send-ActiveUserMessage function within the WDK, take a look:
« https://console.automox.com/manage/worklet-catalog/d3477fbc-a524-5536-91f9-73e3da16377b » 


Great! I was able to pull the info i needed from that worklet. The end user notification and installation now happens as desired. Now just need to hope that they actual read the notification! LOL

Appreciate the assistance.


Great! I was able to pull the info i needed from that worklet. The end user notification and installation now happens as desired. Now just need to hope that they actual read the notification! LOL

Appreciate the assistance.

Anytime! And, feel free to share your code here for feedback. Automox team members and clients can always be your extra set of eyes. Chat soon!


Reply