morup.blogg.se

How to cancel shutdown
How to cancel shutdown







Computer left running after hours - forced shutdown", ::Information) ::WriteEntry($eventSource, "$Loggedon is logged on. Shutdown.exe -s -t 0 -c "Computer left running after hours - forced shutdown"} ::WriteEntry($eventSource, "No Users Logged On.

how to cancel shutdown how to cancel shutdown

::CreateEventSource($eventSource, "Application") $eventSource = "AfterHours Shutdown Policy" $Resultsof = $Loggedon -like '*DOMAIN-NAME*' $Loggedon = Get-WmiObject -Class win32_computersystem -ComputerName $comp | select username Not exactly perfect, because it will only check for domain users, but does accomplish what I wanted. If user does not abort, shutdown will take palce in 5 minutes.log to Event Log If user is logged on, send them the VBScript to allow aborting the shutdown. If no user logged on, then shutdown the PC now.Log to Event Log I setup a powershell script to do the check and take the appropriate action if a user is logged on. Also needed a local user with Admin rights, and set powershell Set-ExecutionPolicy to unrestricted.

how to cancel shutdown

I did get this to work utilizing GPP Task Scheduler, PSexec.exe and a couple of scripts.









How to cancel shutdown