Script shutdown a computer with gpo

Solution 1:

Have a look at Sysinternal's pssshutdown, in conjuction with the Windows at command you can create a daily scheduled task to perform this. The utility allows for customized message box, default time out and presents a window prompting the user to cancel or continue the shutdown.

Create a Group Policy with a Computer Logon script something like:

REM Schedule computer shutdown task using AT.
SET SHUTDOWNTIME=22:00
SET TIMEOUT=600

IF EXIST "%PROGRAMFILES%\PStools\psshutdown.exe" (
    REM Clear at tasks
    AT.EXE /delete /yes
    REM Schedule shutdown daily, repeat in case of user cancellation.
    AT.EXE %SHUTDOWNTIME% /EVERY:m,t,w,th,f,s,su "%PROGRAMFILES%\PStools\psshutdown.exe" -accepteula -c -f -k -t %TIMEOUT% -m "Nightly shutdown in progress.  Click CANCEL if you need to continue using this computer."
)

You will need to customize the path to psshutdown to match your environment.