locked
TS fails to capture OS when installing updates RRS feed

  • Question

  • Hi

    Scenario CM 2012 R2

    Deploying a build and capture TS

    If it installs updates in the TS the “Prepare Configuration Manager Client” step fails

    If software updates are not set to install it works fine

    I am not sure why it fails here?

    After the client cache us deleted as part of the “Prepare Configuration Manager Client” step

    Stopped the service 'ccmexec' successfully PrepareSMSClient 17/02/2014 13:52:15 3484 (0x0D9C)
    Successfully stopped the client agent service. PrepareSMSClient 17/02/2014 13:52:15 3484 (0x0D9C)
    Removing SitePolicy succeeded. PrepareSMSClient 17/02/2014 13:52:15 3484 (0x0D9C)
    UnAssigning the SMSClient succeeded PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    Successfully opened client certificate store. PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    No certificates to delete PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    Deleting Client properties from file C:\WINDOWS\SMSCFG.INI succeeded. PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    Reseting the Trusted Root Key successful PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    Deleting instance of 'CCM_Client' successful PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    Deleting any existing TS execution requests so they are not captured into the image PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    Deleting 0 instance(s) of 'CCM_TSExecutionRequest' successful PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    Deleting any existing maintenance tasks so they are not captured into the image PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    Deleting 1 instance(s) of 'SMS_MaintenanceTaskRequests' successful PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    Successfully reset Registration status flag to "not registered" PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    Successfully disabled provisioning mode. PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    Start to cleanup TS policy PrepareSMSClient 17/02/2014 13:52:16 3484 (0x0D9C)
    getPointer()->ExecQuery( BString(L"WQL"), BString(pszQuery), lFlags, pContext, ppEnum ), HRESULT=ffffffff (e:\nts_sccm_release\sms\framework\core\ccmcore\wminamespace.cpp,463) PrepareSMSClient 17/02/2014 13:57:25 3484 (0x0D9C)
    ns.Query(sQuery, &spEnum), HRESULT=ffffffff (e:\nts_sccm_release\sms\framework\tscore\utils.cpp,3666) PrepareSMSClient 17/02/2014 13:57:25 3484 (0x0D9C)
    Wmi query 'select * from CCM_Policy where PolicySource = 'CcmTaskSequence'' failed, hr=0xffffffff PrepareSMSClient 17/02/2014 13:57:25 3484 (0x0D9C)
    End TS policy cleanup PrepareSMSClient 17/02/2014 13:57:25 3484 (0x0D9C)
    TS::Utility::CleanupPolicyEx(false), HRESULT=ffffffff (e:\nts_sccm_release\sms\client\osdeployment\preparesmsclient\preparesmsclient.cpp,564) PrepareSMSClient 17/02/2014 13:57:25 3484 (0x0D9C)
    Failed to delete policies compiled by TaskSequence (0xffffffff) PrepareSMSClient 17/02/2014 13:57:25 3484 (0x0D9C)
    Failed to prepare SMS Client for capture, hr=ffffffff PrepareSMSClient 17/02/2014 13:57:25 3484 (0x0D9C)
    pCmd->Execute(), HRESULT=ffffffff (e:\nts_sccm_release\sms\client\osdeployment\preparesmsclient\main.cpp,136) PrepareSMSClient 17/02/2014 13:57:25 3484 (0x0D9C)
    Failed to prepare SMS Client for capture, hr=ffffffff PrepareSMSClient 17/02/2014 13:57:25 3484 (0x0D9C)
    Process completed with exit code 4294967295 TSManager 17/02/2014 13:57:25 732 (0x02DC)
    !--------------------------------------------------------------------------------------------! TSManager 17/02/2014 13:57:25 732 (0x02DC)
    Failed to run the action: Prepare Configuration Manager Client.
    Unknown error (Error: FFFFFFFF; Source: Unknown) TSManager 17/02/2014 13:57:25 732 (0x02DC)

    Thanks




    • Edited by Webbeye Tuesday, February 25, 2014 12:42 PM
    Tuesday, February 25, 2014 10:35 AM

Answers

  • Hi!

    This issue occurs if the machine has approx. or more than 65.000 Software Updates polices assigned to the machine. The "Prepare Configuration Manager Client" step in the TS will then fail.
    To work around this issue, simply use below example "PowerShell script" and run it as a step before "Prepare ConfigMgr Client" in the Build Capture TS. The script will clean-up WMI correctly and the "Prepare ConfigMgr Client" will run. 

    This is how the script works!

    1. First the script Counts the number of "Software Updates Polices" assigned to the machine and logs this to the log file in CCM Logs Directory.

    2. The script then tries to remove the "Software Updates Polices". It will fail to delete all polices.

    3. By re-runing these steps, we will sucessfully be able to remove all Software Updates polices.

    $Policy = @(Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'"))
    $policy.Count | Out-File $Env:WinDir\CCM\Logs\OSD_PrePareConfigMgrClient.log -Append
    
    Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'") | Remove-WmiObject
    
    $RemainingPolicy = @(Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'"))
    $RemainingPolicy.Count | Out-File $Env:WinDir\CCM\Logs\OSD_PrePareConfigMgrClient.log –Append
    
    Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'") | Remove-WmiObject
    
    $RemainingPolicy = @(Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'"))
    $RemainingPolicy.Count | Out-File $Env:WinDir\CCM\Logs\OSD_PrePareConfigMgrClient.log –Append
    
    Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'") | Remove-WmiObject
    
    $RemainingPolicy = @(Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'"))
    $RemainingPolicy.Count | Out-File $Env:WinDir\CCM\Logs\OSD_PrePareConfigMgrClient.log –Append
    Use it for what it is worthr, it resolved my issue :)

    PS! This has been reported to Microsoft Premier Support.


    Best Regards Anders Horgen

    Friday, October 10, 2014 9:02 AM

All replies

  • Not sure if this could be the issue, but take a look at it:

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

    Tuesday, February 25, 2014 1:55 PM
  • I have removed the updates in this article and the problem persists so no I don't think its this

    Thanks

    Kev



    • Edited by Webbeye Tuesday, February 25, 2014 2:07 PM
    Tuesday, February 25, 2014 2:07 PM
  • Hello!

    Did you find the reason behind this problem, get same error. 
    Struggling with the same issue on "Windows Server 2008 R2" build & capture by using the install.vim image.

    Cheers and thanks!


    Best Regards Anders Horgen

    Wednesday, July 9, 2014 10:45 AM
  • Hi

    It was caused by to many software update policies, when the TS tries to read and then delete the policies it encounters an error as there are to many objects.

    The work around was to not target so many updates to the new image reducing the amount of policy objects.



    • Edited by Webbeye Wednesday, July 9, 2014 11:28 AM
    Wednesday, July 9, 2014 11:28 AM
  • Hi!

    Thanks for an quick answer :)
    This is what I was afraid about; that the WMI query times out, when cleaning up WMI before starting the capture.
    How are you able then to create an complete image then With an automated process ?

    This might be an case for Premier Support.


    Best Regards Anders Horgen

    Wednesday, July 9, 2014 11:37 AM
  • Hi Anders,

    I manually created the image instead :/

    As its a limitation on the number software update objects that the WMI query can delete.

    Please advise if MS come up with an automated workaround, if you log a case.

    Good luck!

    Cheers



    • Edited by Webbeye Wednesday, July 9, 2014 11:49 AM
    Wednesday, July 9, 2014 11:49 AM
  • Hi!

    This issue occurs if the machine has approx. or more than 65.000 Software Updates polices assigned to the machine. The "Prepare Configuration Manager Client" step in the TS will then fail.
    To work around this issue, simply use below example "PowerShell script" and run it as a step before "Prepare ConfigMgr Client" in the Build Capture TS. The script will clean-up WMI correctly and the "Prepare ConfigMgr Client" will run. 

    This is how the script works!

    1. First the script Counts the number of "Software Updates Polices" assigned to the machine and logs this to the log file in CCM Logs Directory.

    2. The script then tries to remove the "Software Updates Polices". It will fail to delete all polices.

    3. By re-runing these steps, we will sucessfully be able to remove all Software Updates polices.

    $Policy = @(Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'"))
    $policy.Count | Out-File $Env:WinDir\CCM\Logs\OSD_PrePareConfigMgrClient.log -Append
    
    Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'") | Remove-WmiObject
    
    $RemainingPolicy = @(Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'"))
    $RemainingPolicy.Count | Out-File $Env:WinDir\CCM\Logs\OSD_PrePareConfigMgrClient.log –Append
    
    Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'") | Remove-WmiObject
    
    $RemainingPolicy = @(Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'"))
    $RemainingPolicy.Count | Out-File $Env:WinDir\CCM\Logs\OSD_PrePareConfigMgrClient.log –Append
    
    Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'") | Remove-WmiObject
    
    $RemainingPolicy = @(Get-WMIObject -Namespace root\ccm\policy\DefaultMachine\RequestedConfig -query("Select * from ccm_policy where PolicySource='ccmtasksequence'"))
    $RemainingPolicy.Count | Out-File $Env:WinDir\CCM\Logs\OSD_PrePareConfigMgrClient.log –Append
    Use it for what it is worthr, it resolved my issue :)

    PS! This has been reported to Microsoft Premier Support.


    Best Regards Anders Horgen

    Friday, October 10, 2014 9:02 AM