Objective: Notify user of system reboot in 30 minutes & 'schedule' reboot via `shutdown -t XX`. If the system is still up 30 minutes later, issue 'shutdown(6)' via: Win32_OperatingSystem
History:
I've got a scheduled task that runs as a different user (call it user X) with elevated privileges. Under very specific circumstances I want the script to:
[ul]
[li]Display some sort of pop-up notification to the current logged on user (e.g.: user A); a traditional msgbox[/li]
[li]Execute a command like 'cmd /c shutdown -t 300 -f P:2:18 -c "my comment"' among others
[/ul]
Currently when the script runs under user X's context:
[ul]
[li]Its incapable of displaying pop-ups (msgbox or hta based) to the current logged on user. Not sure how to overcome this.[/li]
[li]The commands don't always execute successfully. The log shows 'wso.Run "cmd /c shutdown -t 300 -f P:2:18 -c ""my comment""",0,False' ran, but the lines after it don't print in the log suggesting there's something wrong/hung somewhere. (Are the limitations to what can be executed locally under a different user's context?)[/li]
[/ul]
While I am interested in getting pop-ups displayed, its less important than making sure the commands execute successfully.
History:
I've got a scheduled task that runs as a different user (call it user X) with elevated privileges. Under very specific circumstances I want the script to:
[ul]
[li]Display some sort of pop-up notification to the current logged on user (e.g.: user A); a traditional msgbox[/li]
[li]Execute a command like 'cmd /c shutdown -t 300 -f P:2:18 -c "my comment"' among others
[/ul]
Currently when the script runs under user X's context:
[ul]
[li]Its incapable of displaying pop-ups (msgbox or hta based) to the current logged on user. Not sure how to overcome this.[/li]
[li]The commands don't always execute successfully. The log shows 'wso.Run "cmd /c shutdown -t 300 -f P:2:18 -c ""my comment""",0,False' ran, but the lines after it don't print in the log suggesting there's something wrong/hung somewhere. (Are the limitations to what can be executed locally under a different user's context?)[/li]
[/ul]
While I am interested in getting pop-ups displayed, its less important than making sure the commands execute successfully.