Shutdown script doesn't work

T

Tony Liu

Hello,
Configuring it as a startup script works. Works too as a logoff script. But
not working for shuttdown script. My script is as follows:


Dim oShell
Set oShell = CreateObject("Wscript.Shell")

Set objEmail = CreateObject("CDO.Message")

objEmail.From = "(e-mail address removed)"
objEmail.To = "(e-mail address removed)"
objEmail.Subject = oShell.ExpandEnvironmentStrings("is shutting down by " )
objEmail.Textbody = now


objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _
"smail2.superb.net"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send

Which configuration should I check?

Thanks

Tony
 
T

Tony Liu

Hello,
I'm using shutdown -r -t 0 to reboot the server, shutdown script in GPO not
working. Oneday suddently the server was totally shutdown(not reboot), the
scirpt works. I just want to know the shutdown script in GPO running or not
when I reboot a server.

Thanks
 
T

Tony Liu

Sorry, it seems working when I shutdown by clicking Start->Shutdown. If I
use shutdown -r -t 0, script doesn't run. I'm keeping on trying some
different options of shutdown.exe to see if I have a luck.

Thanks
 
G

Guest

Hi,

I use the shutdown.exe all the time in a Script but I don't use a GPO,
instead I schedule it in scheduled tasks. As Shutdown.exe will let you
remotely shutdown and startup computers using the -m command you can do it
remotely. I shutdown all my computers every night with it.

Remember that with Server 2003 you HAVE to specify a reason so you will need
to add the reason code and the explanation to the script or it won't work
with server 2003. Do shutdown.exe /? at the command prompt on Server 2003 to
get the options. I don't have the server in front of me so I cannot remember
the exact ones.

Cheers,
Lara
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top