#196459 - 2009-10-23 12:38 AM
Re: Restarting Kix script upon widows restart
[Re: Georges_K]
|
Glenn Barnas
KiX Supporter
   
Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
|
I have a script that interfaces with WSUS - called WUS.KIX. You can download the WSUS Library package from my web site. You'll also need to download the tcLib package for scheduled task management..
Review the WUS.KIX script - you'll learn how to use the task control library to create a scheduled task to run "At Startup" using specific credentials. It works quite well.. We use the WUS script to precisely schedule the installation of WSUS-based updates to our servers. The script creates a restart task, runs updates, reboots, then repeatedly downloads & installs updates, rebooting after each set of updates. When no more updates are installed, or the last set of updates does not require a reboot, the "At Startup" task is removed.
We're about to publish an update to this tool in a few weeks, but the current code will provide enough ideas for you to do what you need. I have another tool that "wakes up" and checks for software install requests, allowing us to schedule updates and installs on our servers without intervention - it uses similar logic to install software and continue after repeated reboots.
The concept of using runas or other tools for elevated rights management is dodgy at best. Using a scheduled task is easy to implement (4 lines of code using tcLib.UDF and JT.exe) and allows great flexibility in how it is run, when it runs, and what account is used to run it. It can be managed locally or remotely, as well. I'm about a week away from publishing a tool that will allow a non-admin user to run a script that checks for a set of circumstances and requests that a task requiring admin rights be run - it is scheduled and run within seconds, without ever exposing the admin tool to the user - all via scheduled tasks. Powerful! I strongly recommend you check it out.
Glenn
PS - the tcLib UDF can be downloaded from the resource pages on my web site. You will need to register to download the WSUS Library, and you can download the complete Task Control library as well, which includes the JT.exe, sample code, the tcLib library, and full documentation.
_________________________
Actually I am a Rocket Scientist!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1471 anonymous users online.
|
|
|