Jump to content


  • 0
tristard

Shutdown after TS

Question

Hello,

 

I'm struggling with this for quite some time now.

When the Task Sequence is finished it always reboots the computer, i don't want it to reboot but i want it to shutdown.

I already tried shut it computer down as the last task of the TS but then it hangs on the SCCM logo screen, it won't shutdown or reboot it all.

 

I am using SCCM 2007 SP1, distributing XP and alot of software with the TS.

Is there any way to let the computer shutdown after the task sequence?

 

Thanks :).

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0

Well i figured this out myself already, so for people who want to do this, i will explain.

The following files are all in: \\<distributionserver>\Package\Shutdown\

 

install.cmd

regedit /s \\<distributionserver>\Package\Shutdown\AutoLogin.reg 

xcopy /s "\\<distributionserver>\Package\Shutdown\cleanup.cmd" "C:\Documents and Settings\All Users\Start Menu\Programs\Startup"

 

Autologin.reg

Windows Registry Editor Version 5.00 

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon] 
"DefaultUserName"="administrator" 
"DefaultPassword"="password" 
"AutoAdminlogon"="1" 

 

cleanup.cmd

reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultPassword /f 
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon" /v DefaultUsername /f 
reg delete "HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon" /v AutoAdminLogon /f

shutdown.exe -s 
Attrib -r
DEL %0
EXIT

 

 

I have a package with the "shutdown" folder as "data source" and i run "install.cmd" as program.

In The last step of the task sequence this program will run.

After that the computer reboots as usual but logs in automatically, runs a shutdown script and deletes all references (the script will be deleted out of the startup folder and the auto-login registry keys will also be deleted).

 

The base of this script comes from some post from another forum, but it's heavily modified.

Share this post


Link to post
Share on other sites

  • 0

why did you want to shutdown the computers as a matter of interest ?

 

We have these advertisements running at night, but it's a waste of energy to let the computers on for the whole night.

We do have another shutdown script that runs remotely but with this the computers will shut down almost immediately when they are done, this will save costs because we'll do this almost every night for a certain collection of pc's.

Share this post


Link to post
Share on other sites

  • 0

one other thing, can you please check the SMSTS.log file of the pc's you run this on, and verify that they have the following line

 

Task Sequence Completed 0x00000000

 

if not, you might have reports that the task sequence never actually finishes,

 

just wondering..

Share this post


Link to post
Share on other sites

  • 0

one other thing, can you please check the SMSTS.log file of the pc's you run this on, and verify that they have the following line

 

Task Sequence Completed 0x00000000

 

if not, you might have reports that the task sequence never actually finishes,

 

just wondering..

 

The smstslog in c:\smstslog did not change, the last date it has modified was the date that i made the image for the machine.

The smstslog in C:\WINDOWS\system32\CCM\Logs says:

<![LOG[successfully finalized logs to SMS client log directory from C:\WINDOWS\system32\CCM\Logs]LOG]!><time="10:23:31.092+-120" date="10-20-2009" component="OSDSetupHook" context="" type="1" thread="1488" file="tslogging.cpp:1536">
<![LOG[Cleaning up task sequencing logging configuration.]LOG]!><time="10:23:31.092+-120" date="10-20-2009" component="OSDSetupHook" context="" type="0" thread="1488" file="tslogging.cpp:578">

 

So not the line you are seeking for, the configmgr status says:

The task sequence manager successfully completed execution of the task sequence.

And when it has rebooted and shutdown it says:

The SMS Advanced client was reassigned. The previous site code was "". The new site code is "XXX".

 

So is this ok or is that missing line you are saying crucial?

 

 

Edit: nevermind i looked in C:\WINDOWS\system32\CCM\Logs\smsts-20091020-102330.log and i found this

<![LOG[Task sequence completed 0x00000000]LOG]!><time="10:23:27.623+-120" date="10-20-2009" component="OSDSetupHook" context="" type="1" thread="1488" file="basesetuphook.cpp:1381">

 

So i guess it's ok then :D, the line exists so it successfully completes :D

Share this post


Link to post
Share on other sites

  • 0

Another approach is making a Scheduled Task, which runs at startup with the following commands:
cmd.exe /c shutdown.exe -s -f -t 05 & schtasks.exe /delete /TN %path to scheduled Task% /f

Options
-f = force
-t ## = time to wait until shutdown
%path to scheduled Task% = the path to task \...\...\Name

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.