Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timing Program's After Running options

Status
Not open for further replies.

SMSBaby

Technical User
Aug 22, 2003
6
0
0
GB
Is there a way to set time for “After running” options for a Program? I would like to try and let SMS reboot PC after job has run but can not find timer settings for it (do they exist?).
I usually run programs as default “No action required”, and set reboot time within kix32 script (users get 300 seconds notification before system reboots).Could something similar be done with “SMS restarts computer” and “Program restarts computer” options.
thank you
 
personally I use shutdown.exe

so in sms installer it would look like:

item: Execute Program
Pathname=%win%\Shutdown.exe
Command Line=/L /R /T:60 "Need to reboot to finalize software installation" /C /Y
end
 
I already use shutdown command with contex:

Shell "cmd /c echo. [@date @time] Rebooting >> $LogFile"
Shutdown("","Security Build Updates Installation Complete - restarting",300,1,1)
Exit

I was wondering if there is a way to set timer for “SMS restarts computer” somewhere within SMS itself.Or at least find out how long is user notification before PC reboots(as noted in operations guide)

From SMS2003 Operations Guide:
After running (optional)
Specify what happens after the program has completed. You can choose one of the following options:
SMS restarts computer-After the program runs successfully, if a user is logged on, SMS prompts the user that the system must be restarted. If no user is logged on, SMS restarts the computer.
 
What we do is have a query that shows the names of the collection that we want for PsShutDown to run and dump the Query to a file. Then, PsShutdown has a setting to read all the computers from a file.

IE: psshutdown \\computer @<file_name> -r -f -c -t 600 -m "<message>"

Make sure that you put \\computer in there since if you do not do that, it will reboot the computer that you are running the script from. The only parameter that would change is the <file_name> and the <message>.

Hope this helps,



Gladys Rodriguez
GlobalStrata Solutions
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top