Task Sequence still failing because of update related unexpected reboot in SCCM 2012 R2 SP1 RRS feed

  • Question

  • Hi guys,

    I just tested the task sequence resiliency that has been added in R2 SP1 and my TS still fails when an windows update triggers an unexpected reboots.

    My SMSTS.log shows that my TS waits for the ccmexec process for 1 minute and then fails with errorcode 0x87d01012. I uploaded the interesting part for you.

    Does anyone have experience with this?

    Best regards,


    best regards, Philip

    Wednesday, June 17, 2015 12:16 PM

All replies

  • Hi,

    There might be a update that triggers multiple restarts after the task sequence successfully runs the Install Software Updates task. Please check the KB below.

    Task sequence fails in Configuration Manager if software updates require multiple restarts

    Best Regards,


    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    • Edited by Joyce L Thursday, June 18, 2015 9:35 AM
    Thursday, June 18, 2015 9:34 AM
  • Hi Joyce,

    thanks for you answer. But that was not my question. I know that it has to do with an windows update. I am also aware of that KB article you sent.

    My question is: Did anyone successfully test the new task sequence resilience that was promised in R2 SP1?

    Because my test shows that nothing has changed. My TS still fails when an unexpected reboot is triggered. Can anyone confirm this?

    best regards, Philip

    Thursday, June 18, 2015 12:28 PM
  • I am still seeing the same exact issue after updating to 2012 R2 SP1.  I even tried making a new TS and it had the same issue.  Is the "Retry this step" option working for anyone?
    Tuesday, June 23, 2015 5:37 PM
  • Same here fellas... I don't see it retrying even once. Getting the exact same lines as in Philip's uploaded smsts.log: 

    The action (Install Software Updates) requested a retry

    followed by 

    Task Sequence environment not found.

    and then the 0x87d01012 error.

    Back to disabling software updates in the Task Sequence until there's a definite fix.

    Not a happy camper :(

    Wednesday, July 15, 2015 10:06 AM
  • Great to see that I'm not alone with this Problem. Would be cool to read from an Microsoft employee to confirm this behaviour.

    +++ UPDATE +++

    Just found an interesting blogpost. Seems like the retry feature works with 8.1, but not with 7. Can someone confirm this?


    best regards, Philip

    Wednesday, July 15, 2015 10:23 AM
  • I also does not work in my lab. I just pinged the product group ...

    Torsten Meringer | http://www.mssccmfaq.de

    Wednesday, July 15, 2015 2:37 PM
  • Hi Torsten,

    Have you heard anything from Them?

    Thomas Forsmark Soerensen

    Thursday, August 6, 2015 8:35 AM
  • Unfortunately not. I've asked again just yesterday, but without success so far.

    Torsten Meringer | http://www.mssccmfaq.de

    Thursday, August 6, 2015 8:52 AM
  • Hi Again,

    Still not anything new from the product team?

    If it is not supposed to be working with Windows 7 it would be nice to know :-D

    Thomas Forsmark Soerensen

    Friday, August 21, 2015 11:43 AM
  • We are experiencing the same problems. The problems started to appear, after the August "update tuesday" patches, and affect win7 osd, regardles of "Retry option" selection in SCCM R2 SP1.

    Any news regarding this issue?

    Friday, August 28, 2015 12:03 PM
  • Confirmed the same problem here yesterday as well - disappointing to say the least.
    Saturday, October 3, 2015 11:51 AM
  • Back to disabling software updates in the Task Sequence until there's a definite fix.

    Why? If you using offline injection (either manually or through offline updates) you'll never run into this issue and will reduce your deployment time also.

    Jason | http://blog.configmgrftw.com | @jasonsandys

    Saturday, October 3, 2015 8:38 PM
  • Fair point. Though in my experience, not all updates play well with offline servicing, which leaves the updates step in the Task Sequence a necessary thing. Still an issue for me.
    Monday, October 5, 2015 8:56 AM

  • Why? 
    Because the task sequence step does not work as expected. Using offline injection is a workaround. 

    Torsten Meringer | http://www.mssccmfaq.de

    Monday, October 5, 2015 9:34 AM
  • This Powershell script is using offline servicing to inject updates that need a second reboot. You could also schedule it with Task Scheduler). It generates a log file in c:\windows\logs. Please also check your offlineservcing.log logfile.

    This script is provided as is and MUST be run on your SCCM Site Server.

    Function Get-SiteCode {
        (Get-WmiObject -Namespace "root/sms" -Query "SELECT * FROM SMS_ProviderLocation WHERE ProviderForLocalSite='true'").SiteCode
    Function Write-Log {
        #Pass on the message to Write-Verbose if -Verbose was detected
        Write-Verbose $Message
        #only write to the log file if the $LoggingPreference variable is set to Continue
        if ($LoggingPreference -eq "Continue")
            Write-Output "$(Get-Date) $Message" | Out-File -FilePath $LogFile -Append
    } #end function
    Function Get-UpdateKBListFromURL {
        Write-Log "Get Update List from URL: $url"
        $UpdateList = @()
            $WebClient = New-Object System.Net.WebClient
            $listKB= ($WebClient.DownloadString($url) |
            Select-String "/kb/([0-9]{7,8})" -allmatches |
            Select-Object -ExpandProperty Matches |
            Select-Object -ExpandProperty Groups |
            where-object { -not ( $_.Groups ) } |
            Select-Object -ExpandProperty Value -unique)
            Write-Log "Found Updates ($listKB)."
            foreach ($KB in $listKB) {
                $UpdateList += "KB$KB"
        return $UpdateList
    Function Convert-NormalDateToConfigMgrDate {
        param (
            [parameter(Mandatory=$true, ValueFromPipeline=$true)]
    Function create-ScheduleToken {
        ##Create a SMS_ST_NonRecurring object to use as schedule token
        $SMS_ST_NonRecurring = "SMS_ST_NonRecurring"
        $class_SMS_ST_NonRecurring = [wmiclass]""
        $class_SMS_ST_NonRecurring.psbase.Path ="ROOT\SMS\Site_$($SiteCode):$($SMS_ST_NonRecurring)"
        $scheduleToken = $class_SMS_ST_NonRecurring.CreateInstance()
            $scheduleToken.DayDuration = 0
            $scheduleToken.HourDuration = 0
            $scheduleToken.IsGMT = $false
            $scheduleToken.MinuteDuration = 0
            $scheduleToken.StartTime = (Convert-NormalDateToConfigMgrDate $startTime)
            $SMS_ScheduleMethods = "SMS_ScheduleMethods"
            $class_SMS_ScheduleMethods = [wmiclass]""
            $class_SMS_ScheduleMethods.psbase.Path ="ROOT\SMS\Site_$($SiteCode):$($SMS_ScheduleMethods)"
            $script:ScheduleString = $class_SMS_ScheduleMethods.WriteToString($scheduleToken)
    }##### end function
    #### begin function
    Function create-ImageServicingSchedule {
        $SMS_ImageServicingSchedule = "SMS_ImageServicingSchedule"
        $class_SMS_ImageServicingSchedule = [wmiclass]""
        $class_SMS_ImageServicingSchedule.psbase.Path ="ROOT\SMS\Site_$($SiteCode):$($SMS_ImageServicingSchedule)"
        $SMS_ImageServicingSchedule = $class_SMS_ImageServicingSchedule.CreateInstance()
        $SMS_ImageServicingSchedule.Action = 1
        $SMS_ImageServicingSchedule.Schedule = "$($ScheduleString.StringData)"
        # Update the Distribution Point afterwards?
        if ($UpdateDP) {
            $SMS_ImageServicingSchedule.UpdateDP = $true
        else {
            $SMS_ImageServicingSchedule.UpdateDP = $false
        $schedule = $SMS_ImageServicingSchedule.Put()
        $script:scheduleID = $schedule.RelativePath.Split("=")[1]
        # apply Schedule to Image
        $SMS_ImageServicingScheduledImage = "SMS_ImageServicingScheduledImage"
        $class_SMS_ImageServicingScheduledImage = [wmiclass]""
        $class_SMS_ImageServicingScheduledImage.psbase.Path ="ROOT\SMS\Site_$($SiteCode):$($SMS_ImageServicingScheduledImage)"
        $SMS_ImageServicingScheduledImage = $class_SMS_ImageServicingScheduledImage.CreateInstance()
        $SMS_ImageServicingScheduledImage.ImagePackageID = "$($ImagePackageID)"
        $SMS_ImageServicingScheduledImage.ScheduleID = $scheduleID
        $SMS_ImageServicingScheduledImage.Put() | Out-Null
    } ##### end function
    #### begin function
    Function add-UpdateToOfflineServicingSchedule {
        # get CI_ID from UpdateKB
        [array]$list = @()
        $list = Get-UpdateKBListFromURL
        #Write-Host "Processing List: $list"
        foreach ($UpdateKB in $list) {
            #Write-Host "Process KB: $UpdateKB"
            $Update = Get-WmiObject -Namespace root\sms\site_$SiteCode -Class SMS_SoftwareUpdate | where {$_.LocalizedDisplayName -like "*$($UpdateKB)*" -and $_.IsExpired -eq $false -and $_.IsSuperseded -eq $false}
            if ($Update.CI_ID -ne $null) {
                [array]$CIIDs += $Update.CI_ID
                Write-Log "CI_ID added $($Update.CI_ID)."
        #Write-Host "CI_ID: $CIIDs"
        foreach ($CIID in $CIIDs) {
            $SMS_ImageServicingScheduledUpdate = "SMS_ImageServicingScheduledUpdate"
            $class_SMS_ImageServicingScheduledUpdate = [wmiclass]""
            $class_SMS_ImageServicingScheduledUpdate.psbase.Path ="ROOT\SMS\Site_$($SiteCode):$($SMS_ImageServicingScheduledUpdate)"
            $SMS_ImageServicingScheduledUpdate = $class_SMS_ImageServicingScheduledUpdate.CreateInstance()
            $SMS_ImageServicingScheduledUpdate.ScheduleID = $scheduleID
            $SMS_ImageServicingScheduledUpdate.UpdateID = $CIID
            $SMS_ImageServicingScheduledUpdate.Put() | Out-Null
            Write-Log "CI_ID ($CIID) added to schedule ($scheduleID)"
    } #### end function
    #### begin function
    Function run-OfflineServicingManager {
        $Class = "SMS_ImagePackage"
        $Method = "RunOfflineServicingManager"
        $WMIClass = [WmiClass]"ROOT\sms\site_$($SiteCode):$Class"
        $Props = $WMIClass.psbase.GetMethodParameters($Method)
        $Props.PackageID = "$($ImagePackageID)"
        $Props.ServerName = "$(([System.Net.Dns]::GetHostByName(($env:computerName))).Hostname)"
        $Props.SiteCode = "$($SiteCode)"
        $WMIClass.PSBase.InvokeMethod($Method, $Props, $Null) | Out-Null
        Write-Log "Invoke method $Method with parameters ($($Props.PackageID), $($Props.ServerName), $($Props.SiteCode))"
    } #end function
    #### begin Function
    Function get-ImagePackageID {
        $script:ImagePackageID = (Get-WmiObject -Class SMS_ImagePackage -Namespace Root\SMS\site_$SiteCode | where {$_.name -eq "$($Imagename)"}).PackageID
        Write-Log "Package ID `"$($ImagePackageID)`""
    ############ Main Script starts here!
    $schedule = $null
    $ScheduleID = $null
    [array]$script:CIIDs = @()
    $CIID = $null
    $ImagePackageID = $null
    [datetime]$script:StartTime = Get-Date
    $script:loggingFilePreference = "$env:systemroot\Logs\mx_OfflineServicing_$(Get-Date($StartTime) -Format 'yyyyMMdd-hhmmss').log"
    Write-Log "Starting mx_CMOfflineServicing at $(Get-Date($StartTime) -Format 'yyyyMMdd-hhmmss')"
    [string]$script:SiteCode = Get-SiteCode
    Write-Log "SiteCode: $SiteCode"
    [string]$script:url = "https://support2.microsoft.com/kb/2894518/en-us?sd=rss&spid=1060"
    #Get All Images
    $script:ImagePackages = New-Object -TypeName PSObject
    $ImagePackages = (Get-WmiObject -Class SMS_ImagePackage -Namespace Root\SMS\site_$SiteCode)
    [boolean]$script:UpdateDB = $true
    foreach ($imagePackage in $script:ImagePackages) {
        [string]$script:ImageName = $imagePackage.Name
        Write-Log "Processing image `"$($imagePackage.Name)`""
        #Write-Host "Package ID: $ImagePackageID"
    Write-Log "Script mx_CMOfflineServicing ends at $(Get-Date -Format 'yyyyMMdd-hhmmss')"

    Monday, October 5, 2015 10:15 AM
  • I've never ever had an issue (since the ADK for Win 8.1 Update was released at least). Only CBS compliant updates are injected but that's still accounts for the vast majority of them.

    Jason | http://blog.configmgrftw.com | @jasonsandys

    Monday, October 5, 2015 1:30 PM
  • I realise this is an old post but I thought I'd add some coins.

    Offline Servicing doesn't work for Office updates, so there's a split process immediately. It's also useful to have the image go out with the latest updates using the Install Updates task in the TS. Using the offline servicing to update the WIM requires a change request in a lot of the businesses I got to and is only done every quarter, as it can be a drawn out process, whereas adding them via the task sequence does not due to the ability to test and deploy without redeployment of the core components used in the build.

    The retry functionality definitely does not work for Win 7 and it needs to, otherwise what's the point? The other side to this is that I go in as consultancy to places which are moving from other imaging platforms to OSD through ConfigMgr, things like this can undermine confidence in the product.

    Saturday, February 13, 2016 2:57 PM