Scheduled Shutdown Win2k3
I'm trying to schedule a shutdown of a Windows Server 2003 Standard (SP1,
console logged in and locked). I can't seem to get it to work?
Using task scheduler gives the "0x4f7" as the result code when running:
C:\WINDOWS\system32\shutdown.exe /s /t 120 /c "Server Shutdown" /d p:0:0
Its run with correct privileges, local administrator. (workgroup
environment)
The same result code appears when running the above command in a scheduled
batch file. The server is able to successfully shutdown remote xp's. If I
run this command from the console session it works. (same applies if its in
a batch file)
Re: Scheduled Shutdown Win2k3
Mike wrote:
> I'm trying to schedule a shutdown of a Windows Server 2003 Standard (SP1,
> console logged in and locked). I can't seem to get it to work?
>
> Using task scheduler gives the "0x4f7" as the result code when running:
> C:\WINDOWS\system32\shutdown.exe /s /t 120 /c "Server Shutdown" /d p:0:0
>
> Its run with correct privileges, local administrator. (workgroup
> environment)
>
> The same result code appears when running the above command in a scheduled
> batch file. The server is able to successfully shutdown remote xp's. If I
> run this command from the console session it works. (same applies if its in
> a batch file)
Hi,
Add /f to make it a forced shutdown and see if it helps.
If that didn't help:
You might need to enable the remote shutdown privilege for the user
account that is defined as the task user even if you are going to only
operate on the local computer. If the task user is a member of the
local Administrators group, I think the privilege is already in place.
Take a look here for how to add remote shutdown privilege:
http://groups.google.co.uk/groups?th...TNGP09.phx.gbl
Anyway, Psshutdown.exe in SysInternals's free PSTools suite does not
suffer under this limitation and is the tool I recommend to use in
this case.
http://www.sysinternals.com
Alternatively, to avoid any 3rd party tool, you can use a VBScript
instead (I don't think it have the same issue as shutdown.exe, but I
am not 100% sure):
http://groups.google.co.uk/group/mic...b?dmode=source
--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scr...r/default.mspx
Re: Scheduled Shutdown Win2k3
/f switch worked.
I logged the output of the batch file and the results was - workstation
locked use the force switch - something on those lines.
Thanks
"Torgeir Bakken (MVP)" <Torgeir.Bakken-spam@hydro.com> wrote in message
news:uo6D7HbnFHA.572@TK2MSFTNGP15.phx.gbl...
> Mike wrote:
>
>> I'm trying to schedule a shutdown of a Windows Server 2003 Standard (SP1,
>> console logged in and locked). I can't seem to get it to work?
>>
>> Using task scheduler gives the "0x4f7" as the result code when running:
>> C:\WINDOWS\system32\shutdown.exe /s /t 120 /c "Server Shutdown" /d p:0:0
>>
>> Its run with correct privileges, local administrator. (workgroup
>> environment)
>>
>> The same result code appears when running the above command in a
>> scheduled batch file. The server is able to successfully shutdown remote
>> xp's. If I run this command from the console session it works. (same
>> applies if its in a batch file)
> Hi,
>
>
> Add /f to make it a forced shutdown and see if it helps.
>
>
> If that didn't help:
>
> You might need to enable the remote shutdown privilege for the user
> account that is defined as the task user even if you are going to only
> operate on the local computer. If the task user is a member of the
> local Administrators group, I think the privilege is already in place.
>
> Take a look here for how to add remote shutdown privilege:
> http://groups.google.co.uk/groups?th...TNGP09.phx.gbl
>
> Anyway, Psshutdown.exe in SysInternals's free PSTools suite does not
> suffer under this limitation and is the tool I recommend to use in
> this case.
>
> http://www.sysinternals.com
>
> Alternatively, to avoid any 3rd party tool, you can use a VBScript
> instead (I don't think it have the same issue as shutdown.exe, but I
> am not 100% sure):
> http://groups.google.co.uk/group/mic...b?dmode=source
>
>
>
>
>
> --
> torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
> Administration scripting examples and an ONLINE version of
> the 1328 page Scripting Guide:
> http://www.microsoft.com/technet/scr...r/default.mspx
Re: Scheduled Shutdown Win2k3