Deployment Solution

 View Only
  • 1.  Make task wait until reboot

    Posted Mar 15, 2016 02:00 PM

    My process for deploying new PCs is as follows:

    • Scripted install of Win7 Enterprise, via WinPE on a USB drive or booted into automation.
    • Join the domain
    • Run script:
      @echo off
      net user Altiris /delete :: Delete the local account DS created during the scripted install.
      net user administrator lamepassword:: Set the local admin password to the helpdesk's standard.
    • Install MSIE 11 (the campus SCCM system doesn't do this automatically.)

    After this, all the various software packages for new PCs are installed via a bunch of tasks that run the installation .bat files, along with conditionals to consider nonzero successes still success.

    This all works just fine, but I sporadically/randomly get a -1073741502 return code during an installation--and the installation doesn't happen. Upon some investigation, this seems to happen when a successful installation requires a reboot (like MSIE 11), and the next job in line is sent while the PC is in the shutdown phase.

    Here's my current task to install MSIE 11:

    • Run script:
      taskkill /im msiexec.exe /f /t :: Stop any installers currently running
      \\192.0.2.200\NSCap\Software\MSIE11\IE11-Windows6.1-x64-en-us.exe /quiet
    • If return value = 3010 or 0 else :: 3010 means success with a required reboot; we're just declaring 3010 and 0 both successful

    What I'm looking for is a way to tell the NS "don't consider this task complete until the reboot is done".

    Thoughts?

    Thanks!



  • 2.  RE: Make task wait until reboot

    Posted Mar 15, 2016 04:51 PM

    Actually, you just made a neuron fire in my brain prompting me to think of a bit of a Rube Goldberg solution:

    • Create a one-time Scheduled Task on the target PC that, upon boot, will write a temp file \\ns\nscap\temp\%computername%.tmp
    • Set a script to check for the existence of this file once every 10 seconds until it appears.
    • Once it appears, the PC is back on.

    Another thing I'm considering is adding a restart job into the task...I'll have to experiment to see if a restart job is "finished" upon issuing a restart command, or upon the PC coming back on.



  • 3.  RE: Make task wait until reboot

    Broadcom Partner
    Posted Mar 16, 2016 03:01 AM

    Hi mahohmei,

    To wait for the computer to do a reboot you can use this simple workaround (see Screenshots)

    I created a simple Job that includes 3 Tasks...

    1. Task Run Script or Quick Delivery Task

    2. Task Run Script on Task Server (this pings the TaskServer and continues if it is finished - this should give you the time to reboot the computer) if needed modify the value

    3. Task Run Scipt or Quick Delivery Task (continues only of the second task is finished in my example after about 50 secounds)

    Run_script_on_Task_Server.png

     

    Ping_on_Task_Server.png

    this is only a Workaround but should help you to solve the problem...

    Important: make sure you select "Run Script on Task Server"  for the second task in my example

    Network23



  • 4.  RE: Make task wait until reboot

    Posted Mar 16, 2016 12:14 PM
    The rule with Symantec NS and reboots generally (Scripts or Policies) is to suppress the reboot in the installer (/norestart or REBOOT=REALLYSUPPRESS) and have a separate restart Task in Tasks or in Policies use the Advanced > Result based actions > Upon success > Restart computer. Then the agent will know to carry on where it left off once the reboot completes.


  • 5.  RE: Make task wait until reboot

    Broadcom Partner
    Posted Mar 16, 2016 12:54 PM

    I agree with andykn101, but in some instances you cannot control how and when a reboot is tiggered. If you are running for example a script that updates your system with patches and reboots several times duing the update process - you cannot control the reboot process - therefore you can use the method descriped obove. 

    I also prefere andykn101´s method if it is possible...

    Network23



  • 6.  RE: Make task wait until reboot

    Posted Mar 16, 2016 01:21 PM

    To be completely honest, if I just tack a reboot onto a job, the worst case is that it reboots twice. :-)