Messagebox not displaying to prompt user to close application
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?
This discussion is archived and closed to replies. Continue it in the Automox Community Slack.
Discuss on Slack