see:
How to execute System.Windows.Forms from the System Account using Task Scheduler
Hello Experts
We are working on the PowerShell to Pop out message forms to the user Accounts and we are using Add-Type -AssemblyName System.Windows.Forms to create the user interactive messages. We are currently using the SCCM to deploy the PowerShell script across all of the user's computers. But somehow how it is not running and the script is running as a System account.
We have tried to run the PowerShell script using the Task scheduler as well from the system account and we got the error log due to which is it not running from the task scheduler
Below is the error message we are getting
Exception calling "Show" with "4" 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."
What steps we would need to configure so that we won't get these message?????
The pop message is important for us also we will run the script from System account
Thanks in advance