Script shutdown a computer with gpo

scriptingwindows-xp

I have windows server 2003 domain and windows xp workstation. it is necessary that at 6.00 pm on computer was displayed a window (Do you really want to shutdown a computer and Yes/no button).If user click Yes or еxpired 5 minutes computer shutdown, else user click No than appears after an hour window will display again.

Best Answer

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.

Related Topic