Preventing Task Sequence Reboot After Software Install with 3010

Author Message
MikhailCompo

  • Total Posts : 15
  • Scores: 0
  • Reward points : 6550
  • Joined: 7/14/2010
  • Status: offline
Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 14, 2010 6:40 AM (permalink)
0
I have a task sequence to install 4 applications in sequence, all of them have reboot suppression command lines, followed by a reboot initiated by the task sequence (to display a warning message).
 
A number of these applications return a 3010 output code as they need a reboot and the task sequence is forcing this to occur after 30 seconds, I need to be able to prevent the Task Sequence performing an auto reboot.
 
PLEASE can someone help!!!
 
Kind regards
 
Mike
 
#1
    anyweb

    • Total Posts : 791
    • Scores: 62
    • Reward points : 46130
    • Joined: 10/20/2008
    • Location: Niall C. Brady
    • Status: online
    Re:Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 14, 2010 7:10 AM (permalink)
    Step by Step ConfigMgr 2007 Guides | Step by Step ConfigMgr 2012 Guides | Microsoft MVP  - Configmgr
     
    #2
      MikhailCompo

      • Total Posts : 15
      • Scores: 0
      • Reward points : 6550
      • Joined: 7/14/2010
      • Status: offline
      Re:Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 14, 2010 7:14 AM (permalink)
      0
      anyweb


      have a look at this post

      http://social.technet.microsoft.com/Forums/en-US/configmgrosd/thread/60293abd-30a8-4f9c-80d5-e83c0b822a1c


      Thanks Niall, I have seen that, but I do not know how to write a script that would acheive that.  Can someone show me how please!
       
      #3
        anyweb

        • Total Posts : 791
        • Scores: 62
        • Reward points : 46130
        • Joined: 10/20/2008
        • Location: Niall C. Brady
        • Status: online
        Re:Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 14, 2010 7:25 AM (permalink)
        0
        something like this perhaps ? rename to vbs... it could contain mistakes, please test it

        Dim wsh, retval
        Set wsh = CreateObject("WScript.Shell")
        retval = 0

        ' *** Install Application. ***
        retval = wsh.Run("msiexec /i somemsi.msi", 0, True)

        If (retval = 3010) Then
            MsgBox "return code was 3010"
        End If

        ' *** set the return value to 0 anyway. ***
        retval=0

        WScript.Quit(retval)



        <message edited by anyweb on Tuesday, July 20, 2010 3:46 AM>
        Step by Step ConfigMgr 2007 Guides | Step by Step ConfigMgr 2012 Guides | Microsoft MVP  - Configmgr
         
        #4
          MikhailCompo

          • Total Posts : 15
          • Scores: 0
          • Reward points : 6550
          • Joined: 7/14/2010
          • Status: offline
          Re:Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 14, 2010 7:33 AM (permalink)
          0
          Thanks Niall, that is really useful, I will test now.
           
          I have had a thought though - if I run the script to run the app, as soon as the app has started, the script will exit will it not?  If that is the case, then the second task in the sequence would start before the previous has finished which would be fatal.
          Or is that just my inability to read the script above correctly?
           
          #5
            MikhailCompo

            • Total Posts : 15
            • Scores: 0
            • Reward points : 6550
            • Joined: 7/14/2010
            • Status: offline
            Re:Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 14, 2010 7:37 AM (permalink)
            0
             1 Dim Retval
             2 Retval=1112
             3 ' *** Install Application. ***
             4 WindowsXP-KB936929-SP3-x86-ENU.exe /quiet /norestart /log:%temp%\SP3_Install.log
             5 If retval 3010 Then
             6 MsgBox "return code was 3010"
             7 End If
             8 ' *** set the return value to 0 anyway. ***
             9 Retval=7576
            10 WshEnv.Remove("SEE_MASK_NOZONECHECKS")
            11 WScript.Quit(Retval)
            [size=2 font="courier new"]
             
            [size=2 font="courier new"]
             
            [size=2 font="courier new"]Sorry, you will need to explain how to use line 5!  It errors and when i try to use quotes.  I am competent with batch files, but not vbs.

             
            #6
              anyweb

              • Total Posts : 791
              • Scores: 62
              • Reward points : 46130
              • Joined: 10/20/2008
              • Location: Niall C. Brady
              • Status: online
              Re:Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 14, 2010 8:14 AM (permalink)
              0
              sorry, it was a typo, try

              If retval = 3010 Then
              Step by Step ConfigMgr 2007 Guides | Step by Step ConfigMgr 2012 Guides | Microsoft MVP  - Configmgr
               
              #7
                MikhailCompo

                • Total Posts : 15
                • Scores: 0
                • Reward points : 6550
                • Joined: 7/14/2010
                • Status: offline
                Re:Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 14, 2010 10:40 AM (permalink)
                0
                Sorry, I had changed the line numbers!  Its the line with the command:
                 
                Dim Retval
                Retval=0
                ' *** Install Application. ***
                WindowsXP-KB936929-SP3-x86-ENU.exe "/quiet /norestart /log:%temp%\SP3_Install.log"
                If retval 3010 Then
                MsgBox "return code was 3010"
                End If
                ' *** set the return value to 0 anyway. ***
                Retval=0
                WshEnv.Remove("SEE_MASK_NOZONECHECKS")
                WScript.Quit(Retval)
                 
                #8
                  MikhailCompo

                  • Total Posts : 15
                  • Scores: 0
                  • Reward points : 6550
                  • Joined: 7/14/2010
                  • Status: offline
                  Re:Preventing Task Sequence Reboot After Software Install with 3010 Thursday, July 15, 2010 4:57 AM (permalink)
                  0
                  bump
                   
                  #9
                    anyweb

                    • Total Posts : 791
                    • Scores: 62
                    • Reward points : 46130
                    • Joined: 10/20/2008
                    • Location: Niall C. Brady
                    • Status: online
                    Re:Preventing Task Sequence Reboot After Software Install with 3010 Thursday, July 15, 2010 7:29 AM (permalink)
                    0
                    ok try this instead...
                    p.s. i'm not a scripter, so there might be errors.


                    Dim Retval
                    Retval=0

                    ' *** Install Application. ***
                    Dim WSHShell
                    Set WSHShell = WScript.CreateObject("WScript.Shell")


                    ' open normal and don't wait
                    WSHShell.Run "WindowsXP-KB936929-SP3-x86-ENU.exe /quiet /norestart /log:%temp%\SP3_Install.log", 1, false
                    Set WSHShell = Nothing




                    ' *** show us what RETVAL is, unrem to see what retval = ***
                    ' MsgBox "The actual return code was " &retval

                    ' *** unrem to set to 3010 for testing ***
                    'retval = 3010

                    If retval = 3010 Then
                    MsgBox "The return code was 3010, resetting to 0"
                    else
                    MsgBox "The actual return code was " &retval
                    WScript.Quit(Retval)
                    End If



                    ' *** set the return value to 0 anyway. ***
                    Retval=0
                    MsgBox "The return code was reset to " &retval
                    WScript.Quit(Retval)

                    Step by Step ConfigMgr 2007 Guides | Step by Step ConfigMgr 2012 Guides | Microsoft MVP  - Configmgr
                     
                    #10
                      MikhailCompo

                      • Total Posts : 15
                      • Scores: 0
                      • Reward points : 6550
                      • Joined: 7/14/2010
                      • Status: offline
                      Re:Preventing Task Sequence Reboot After Software Install with 3010 Friday, July 16, 2010 5:33 AM (permalink)
                      0
                      The problem with using this script to run the command line, is that as soon as its run it, it closes and returns the error code.

                      So if using it in a task sequence the next step in the sequence will start, making it pretty much useless :(

                      Is there some way the script will wait until the program in the command line completes?

                      Is this a very complex solution to a simple problem, SURELY there is some way to prevent/disable this auto-reboot feature in a task sequence?
                       
                      #11
                        anyweb

                        • Total Posts : 791
                        • Scores: 62
                        • Reward points : 46130
                        • Joined: 10/20/2008
                        • Location: Niall C. Brady
                        • Status: online
                        Re:Preventing Task Sequence Reboot After Software Install with 3010 Friday, July 16, 2010 6:46 AM (permalink)
                        0
                        what do you mean it closes as soon as it runs, are you sure the command line is correct ?
                        Step by Step ConfigMgr 2007 Guides | Step by Step ConfigMgr 2012 Guides | Microsoft MVP  - Configmgr
                         
                        #12
                          MikhailCompo

                          • Total Posts : 15
                          • Scores: 0
                          • Reward points : 6550
                          • Joined: 7/14/2010
                          • Status: offline
                          Re:Preventing Task Sequence Reboot After Software Install with 3010 Monday, July 19, 2010 6:17 AM (permalink)
                          0
                          anyweb

                          what do you mean it closes as soon as it runs, are you sure the command line is correct ?


                          Correct.
                           
                          The command line works fine, the installer starts up in the background.
                           
                          #13
                            MikhailCompo

                            • Total Posts : 15
                            • Scores: 0
                            • Reward points : 6550
                            • Joined: 7/14/2010
                            • Status: offline
                            Re:Preventing Task Sequence Reboot After Software Install with 3010 Monday, July 19, 2010 6:36 AM (permalink)
                            0
                            anyweb

                            what do you mean it closes as soon as it runs, are you sure the command line is correct ?


                            Aha - I think i have spotted the problem - your script uses the false option on the command line for the "WaitOnReturn" option.  I have amended it to true and have re-run the package in the script, package is currently installing, and wscript is still waiting and therefore so is the task sequence.  All good so far, will post back with results soon.
                             
                            #14
                              anyweb

                              • Total Posts : 791
                              • Scores: 62
                              • Reward points : 46130
                              • Joined: 10/20/2008
                              • Location: Niall C. Brady
                              • Status: online
                              Re:Preventing Task Sequence Reboot After Software Install with 3010 Monday, July 19, 2010 7:58 AM (permalink)
                              0
                              ok great !
                              let me know how it goes

                              cheers
                              niall
                              Step by Step ConfigMgr 2007 Guides | Step by Step ConfigMgr 2012 Guides | Microsoft MVP  - Configmgr
                               
                              #15
                                MikhailCompo

                                • Total Posts : 15
                                • Scores: 0
                                • Reward points : 6550
                                • Joined: 7/14/2010
                                • Status: offline
                                Re:Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 28, 2010 5:46 AM (permalink)
                                0
                                Sorry its taken me a while to reply, i have been away (i needed it after the frustration with OSD task sequences!!!)
                                 
                                So, our scripting guy has returned and we have created a basic script that runs the require command and if the installer returns a 0 or 3010, then the script returns a 0.  Otherwise it returns a 1 (failure).
                                 
                                We have tested and the script works fine.  BUT THE STUPID TASK SEQUENCE STILL RESTARTS AFTER 30 SECONDS!!! GGGGGGGGRRRRRR SOOOOOO ANNOYING!!!!
                                 
                                I have checked the task sequence log and it CLEARLY shows that the installer/script return an error code of 0 - therefore the script is doing its job.
                                 
                                However, (this is the interesting bit) I have also checked in the event log of the computer after the 30 second restart has taken place, and the event log clearly shows the message I have added into the task sequence that is supposed to be displayed to the user (but is not displayed) and shows the timeout of 3600 seconds which is not being applied.
                                 
                                So my question is why/how could the "Restart Computer" script in the task sequence be broken?  Does the same thing happen on other users setups or is this unique to me? 
                                 
                                #16
                                  MikhailCompo

                                  • Total Posts : 15
                                  • Scores: 0
                                  • Reward points : 6550
                                  • Joined: 7/14/2010
                                  • Status: offline
                                  Re:Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 28, 2010 7:08 AM (permalink)
                                  0
                                  So how do I attach more than one file to a post?!?!?!?!?!?!
                                   
                                  Instead I have had to zip them up into one file which is annoying.
                                   
                                  So - The script installs SP3, returns error code 0 (see attached log).
                                  Then there is a reboot after 30 seconds which I have not asked for - WHY??????????????
                                  THEN my requested reboot prommpts the user with a 30 minute time out.
                                   
                                  The first reboot is a complete mystery for me - why does it happen?????
                                  Attachment(s)smsts.zip (71.58 KB) - downloaded 40 times
                                   
                                  #17
                                    anyweb

                                    • Total Posts : 791
                                    • Scores: 62
                                    • Reward points : 46130
                                    • Joined: 10/20/2008
                                    • Location: Niall C. Brady
                                    • Status: online
                                    Re:Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 28, 2010 7:21 AM (permalink)
                                    0
                                    ok looking at your log i see this

                                    Installing software for PackageID='S0200026' ProgramID='Install' AdvertID='S0220037' has started, jobID='{8FEA0CF5-9288-4A72-8638-A19B54892F82}'
                                    Waiting for installation job to complete..    InstallSoftware    2010-07-28 11:14:04    2620 (0x0A3C)

                                    Waiting for job status notification...
                                    ........
                                    Waiting for job status notification...    InstallSoftware    2010-07-28 11:29:36    2620 (0x0A3C)
                                    Received job completion notification from Execution Manager
                                    Installation completed with exit code 0x80070bc2
                                    Installation successful, reboot required
                                    Releasing of Job Request successful
                                    Process completed with exit code 0

                                    so there you have it, the installation of XPsp3 actually resulted in an exit code of 0x80070bc2

                                    does that make sense to you ? i think your script or wrapper is still returning the value above
                                    Step by Step ConfigMgr 2007 Guides | Step by Step ConfigMgr 2012 Guides | Microsoft MVP  - Configmgr
                                     
                                    #18
                                      MikhailCompo

                                      • Total Posts : 15
                                      • Scores: 0
                                      • Reward points : 6550
                                      • Joined: 7/14/2010
                                      • Status: offline
                                      Re:Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 28, 2010 10:32 AM (permalink)
                                      0
                                      HURAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYYYYYYYYYYYYYYYYYYYYYYYYYY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                                       
                                      It worked!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                                       
                                      You have no idea how grateful I am.  I was beginning to think that it was nothing to do with the 3010 - that hex code was very misleading and we had assumed that it was not interpreted at all by the TS - but in retrospect 3010 = BC2 hex which must equate to 0x80070bc2.  There was a minor error in the script which is why the 3010 was still being returned.
                                       
                                      We have expanded on the script massively to include free HDD space and a few other checks, but simply identifying the 3010 was generating these mystery reboots has been very valuable.
                                       
                                      We intend to use Task Sequences for installing multiple applications or app + patches which would have been scuppered without your help.
                                       
                                      Thanks Niall.
                                       
                                      #19
                                        anyweb

                                        • Total Posts : 791
                                        • Scores: 62
                                        • Reward points : 46130
                                        • Joined: 10/20/2008
                                        • Location: Niall C. Brady
                                        • Status: online
                                        Re:Preventing Task Sequence Reboot After Software Install with 3010 Wednesday, July 28, 2010 11:34 AM (permalink)
                                        0
                                        great to hear that it's working now, nice work :)
                                        Step by Step ConfigMgr 2007 Guides | Step by Step ConfigMgr 2012 Guides | Microsoft MVP  - Configmgr
                                         
                                        #20
                                          Online Bookmarks Sharing: Share/Bookmark

                                          Jump to:

                                          Current active users

                                          There are 0 members and 1 guests.

                                          Icon Legend and Permission

                                          • New Messages
                                          • No New Messages
                                          • Hot Topic w/ New Messages
                                          • Hot Topic w/o New Messages
                                          • Locked w/ New Messages
                                          • Locked w/o New Messages
                                          • Read Message
                                          • Post New Thread
                                          • Reply to message
                                          • Post New Poll
                                          • Submit Vote
                                          • Post reward post
                                          • Delete my own posts
                                          • Delete my own threads
                                          • Rate post

                                          2000-2012 ASPPlayground.NET Forum Version 3.9