MSEndpointMgr / ModernDriverManagement

Official repo of Modern Driver Management from MSEndpointMgr.com
https://www.msendpointmgr.com
MIT License
133 stars 80 forks source link

Failed to Download Package Content #249

Open TankNation opened 1 year ago

TankNation commented 1 year ago

Having an issue where in my Task Sequence, I can successfully run DebugMode and verify existing drivers, however when those drivers are called for download via baremetal method using MDM script in Task Sequence, I get a ...

Failed to download package content with PackageID 'xxxxx8F4'. Return code was: -2147467259

To further test. I created a task sequence that just boots to WinPE and attempts the baremetal step. This works without issue and the package downloaded where it needed to and drivers installed successfully. With no changes to the package, and using the same task sequence step for drivers in an actual OS install Task Sequence, after Applying Operating System I am seeing the same error as originally mentioned.

Not sure what the difference is, and why it works in one instance of WinPE and not the other. And clearly don't understand the cause, or approach in resolving the issue and was wondering if any others who may have encountered the same issue had a resolution, or if anyone at all has any thoughts.

ApplyDriverPackage.log : ApplyDriverPackageLog

Task Sequence Step: TaskSequenceChain Verify step works without issue, have this configured early in the task sequence to exit out if no drivers found.

Screens of relevant failing steps in smsts.log: LogPart1 LogPart2 LogPart3

And as text:

 ============================== [ OSDRunPSScript.exe ] ==============================   RunPowerShellScript 6/30/2023 1:26:02 PM    1372 (0x055C)
Running module version 5.0.9106.1000 from location 'X:\sms\bin\x64\OSDRunPowerShellScript.exe'  RunPowerShellScript 6/30/2023 1:26:02 PM    1372 (0x055C)
Package ID containing the PowerShell script is XXX008A5 RunPowerShellScript 6/30/2023 1:26:02 PM    1372 (0x055C)
PowerShell script name is Invoke-CMApplyDriverPackage.ps1   RunPowerShellScript 6/30/2023 1:26:02 PM    1372 (0x055C)
The execution scope for running the PowerShell script is specified not to verify the signature of the scripts. This is unsafe and potentially risk running malicious scripts.   RunPowerShellScript 6/30/2023 1:26:02 PM    1372 (0x055C)
Sending warning status message  RunPowerShellScript 6/30/2023 1:26:02 PM    1372 (0x055C)
   Setting URL = https://MP2.my.domain, Ports = 80,443, CRL = false RunPowerShellScript 6/30/2023 1:26:02 PM    1372 (0x055C)
   Setting Server Certificates. RunPowerShellScript 6/30/2023 1:26:02 PM    1372 (0x055C)
   Setting Authenticator.   RunPowerShellScript 6/30/2023 1:26:02 PM    1372 (0x055C)
Creating CCMCertStore   RunPowerShellScript 6/30/2023 1:26:02 PM    1372 (0x055C)
Signing Certificate is not available in the store   RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
CCMRetrieveCertificateContext failed : 0x87d00215   RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
CCMRetrieveCertificateContext(eType, ppTmpContext), HRESULT=87d00215 (K:\dbs\sh\cmgm\0405_083130\cmd\0\src\Framework\security\MsgAuth\CCMGenCert\ccmgencert.cpp,3454)   RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
CCMGetCurrentCertificateContext(eCertMsgAuthSignature, ppCertContext), HRESULT=87d00215 (K:\dbs\sh\cmgm\0405_083130\cmd\0\src\Framework\security\MsgAuth\CCMGenCert\ccmgencert.cpp,3511)    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
pSigningCertContext != NULL, HRESULT=80004005 (K:\dbs\sh\cmgm\0405_083130\cmd\15\src\Framework\TSCore\utils.cpp,7444)   RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Signing certificate context is NOT defined. RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
PrepareTransportEx() failed. 0x80004005.    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
PrepareTransport(mtHttpTransport), HRESULT=80004005 (K:\dbs\sh\cmgm\0405_083130\cmd\15\src\Framework\TSCore\utils.cpp,7647) RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Non fatal error 0x80004005 in sending task sequence execution status message to Management Point    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Running PowerShell script: 'Invoke-CMApplyDriverPackage.ps1'(PkgID: XXX008A5) with execution policy: 'Bypass'   RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Will run PowerShell script under SYSTEM account RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
PowerShell path: X:\windows\system32\windowspowershell\v1.0\powershell.exe  RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
ResolveSource flags: 0x00000000 RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
SMSTSPersistContent: . The content for package XXX008A5 will be persisted   RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
DownloadOnDemand flag is true. Attempting to download content locally for Package XXX008A5. RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Locations: Multicast = 0, HTTP = 9, SMB = 0.    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Package Flags: 0x00000000   RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Multicast is not enabled for the package.   RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Trying https://DP1.my.domain/sms_dp_smspkg$/XXX008a5.   RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
GetDirectoryListing() entered   RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Initializing HTTP transport.    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Setting URL = https://DP1.my.domain/sms_dp_smspkg$/XXX008a5.    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
   Address=https://DP1.my.domain, Scheme=https, Object=/sms_dp_smspkg$/XXX008a5, Port=443.  RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
WinHttp credentials set.    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
CLibSMSMessageWinHttpTransport::Send: WinHttpOpenRequest - URL: DP1.my.domain:443  PROPFIND /sms_dp_smspkg$/XXX008a5    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
In SSL, but not using DP auth token or authenticator    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
In SSL, but with no client cert.    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
In SSL, but with no media cert. RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Http response: 401 -    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
401 - Unsuccessful with anonymous access. Retrying with context credentials.    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Using thread token for request. RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Http response: 401 - Unauthorized   RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
401 - Unsuccessful with context credentials. Retrying with supplied credentials.    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Request was successful. RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
DAV response string is:
<![CDATA[<?xml version="1.0" encoding="utf-8" ?><D:multistatus xmlns:D="DAV:"><D:response><D:href>http://DP1.my.domain/sms_dp_smspkg$/sccm?/XXX008a5/</D:href><D:propstat><D:status>HTTP/1.1 200 OK</D:status><D:prop><D:getcontenttype/><D:supportedlock/><D:getetag/><D:creationdate/><D:iscollection>1</D:iscollection><D:resourcetype><D:collection/></D:resourcetype><D:ishidden>0</D:ishidden><D:displayname>http://DP1.my.domain/sms_dp_smspkg$/sccm?/XXX008a5/</D:displayname><D:getlastmodified></D:getlastmodified><D:getcontentlanguage/><D:getcontentlength>0</D:getcontentlength></D:prop></D:propstat></D:response><D:response><D:href>http://DP1.my.domain/sms_dp_smspkg$/XXX008a5/sccm?/Invoke-CMApplyDriverPackage.ps1</D:href><D:propstat><D:status>HTTP/1.1 200 OK</D:status><D:prop><D:getcontenttype/><D:lockdiscovery/><D:supportedlock/><D:getetag/><D:getcontentlanguage/><D:iscollection>0</D:iscollection><D:creationdate/><D:resourcetype/><D:ishidden>0</D:ishidden><D:displayname>http://DP1.my.domain/sms_dp_smspkg$/XXX008a5/sccm?/Invoke-CMApplyDriverPackage.ps1</D:displayname><D:getlastmodified>Tue, 27 Jun 2023 20:38:27 GMT</D:getlastmodified><D:getcontentlength>125668</D:getcontentlength></D:prop></D:propstat></D:response></D:multistatus>]]>  RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
List of files to be downloaded  RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
  File: http://DP1.my.domain:443/sms_dp_smspkg$/XXX008a5/sccm?/Invoke-CMApplyDriverPackage.ps1  RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
GetDirectoryListing() successfully completed    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Succeeded loading resource DLL 'X:\sms\bin\x64\1033\TSRES.DLL'  RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
401 - Unsuccessful with anonymous access. Retrying with context credentials.    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
401 - Unsuccessful with context credentials. Retrying with supplied credentials.    RunPowerShellScript 6/30/2023 1:26:03 PM    1372 (0x055C)
Downloading file /sms_dp_smspkg$/XXX008a5/sccm?/Invoke-CMApplyDriverPackage.ps1 range 0-125667  RunPowerShellScript 6/30/2023 1:26:04 PM    1372 (0x055C)
Downloaded file from http://DP1.my.domain:443/sms_dp_smspkg$/XXX008a5/sccm?/Invoke-CMApplyDriverPackage.ps1 to C:\_SMSTaskSequence\Packages\XXX008A5\Invoke-CMApplyDriverPackage.ps1    RunPowerShellScript 6/30/2023 1:26:04 PM    1372 (0x055C)
VerifyContentHash: Hash algorithm is 32780  RunPowerShellScript 6/30/2023 1:26:04 PM    1372 (0x055C)
Content successfully downloaded at C:\_SMSTaskSequence\Packages\XXX008A5.   RunPowerShellScript 6/30/2023 1:26:04 PM    1372 (0x055C)
Resolved source to 'C:\_SMSTaskSequence\Packages\XXX008A5'  RunPowerShellScript 6/30/2023 1:26:04 PM    1372 (0x055C)
Working dir 'C:\_SMSTaskSequence\Packages\XXX008A5' RunPowerShellScript 6/30/2023 1:26:04 PM    1372 (0x055C)
Command line for extension .exe is "%1" %*  RunPowerShellScript 6/30/2023 1:26:04 PM    1372 (0x055C)
Set command line: Run PowerShell Script RunPowerShellScript 6/30/2023 1:26:04 PM    1372 (0x055C)
PowerShell command line is NOT shown in the log ('OSDLogPowerShellParameters' is NOT set to 'True') RunPowerShellScript 6/30/2023 1:26:04 PM    1372 (0x055C)
Executing command line: Run PowerShell Script with options (0, 4)   RunPowerShellScript 6/30/2023 1:26:04 PM    1372 (0x055C)
================= [OSDDownloadContent.exe] =================
    OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
Running module version 5.0.9106.1000 from location 'X:\sms\bin\x64\OSDDownloadContent.exe'  OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
OSDDownloadDownloadPackages = XXX00905  OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
OSDDownloadDestinationLocationType = Custom OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
OSDDownloadContinueDownloadOnError = 0  OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
Packages will be downloaded to custom download location: 'C:\_SMSTaskSequence\DriverPackage'    OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
Getting package content: XXX00905, version: 0   OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
GetPackageContent:  OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
Resolving content for SMS Package XXX00905  OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
Site Code FSE   OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
MP https://MP1.my.domain.org    OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
TSPkgVar _SMSTSXXX00905 OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
RunFromDPEnabled false  OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
Resolving local content for XXX00905:0  OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
spCacheMgr.createInstance(CLSID_ContentCacheManager, CLSCTX_LOCAL_SERVER), HRESULT=80040154 (K:\dbs\sh\cmgm\0405_083130\cmd\15\src\Framework\TSCore\resolvesource.cpp,4646) OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
Failed to create instance of of ICacheManager. Is ccmexec running?, hr=0x80040154   OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
   Setting URL = https://MP1.my.domain.org, Ports = 80,443, CRL = false OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
   Setting Server Certificates. OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
   Setting Authenticator.   OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
Creating CCMCertStore   OSDDownloadContent  6/30/2023 1:26:08 PM    752 (0x02F0)
================= [OSDDownloadContent.exe] =================    RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Running module version 5.0.9106.1000 from location 'X:\sms\bin\x64\OSDDownloadContent.exe'  RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
OSDDownloadDownloadPackages = XXX00905  RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
OSDDownloadDestinationLocationType = Custom RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
OSDDownloadContinueDownloadOnError = 0  RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Packages will be downloaded to custom download location: 'C:\_SMSTaskSequence\DriverPackage'    RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Getting package content: XXX00905, version: 0   RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
GetPackageContent:  RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Resolving content for SMS Package XXX00905  RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Site Code FSE   RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
MP https://MP1.my.domain.org    RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
TSPkgVar _SMSTSXXX00905 RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
RunFromDPEnabled false  RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Resolving local content for XXX00905:0  RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
spCacheMgr.createInstance(CLSID_ContentCacheManager, CLSCTX_LOCAL_SERVER), HRESULT=80040154 (K:\dbs\sh\cmgm\0405_083130\cmd\15\src\Framework\TSCore\resolvesource.cpp,4646) RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
   Setting URL = https://MP1.my.domain.org, Ports = 80,443, CRL = false RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
   Setting Server Certificates. RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
   Setting Authenticator.   RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Creating CCMCertStore   RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Failed to create instance of of ICacheManager. Is ccmexec running?, hr=0x80040154   RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Signing Certificate is not available in the store   OSDDownloadContent  6/30/2023 1:26:09 PM    752 (0x02F0)
CCMRetrieveCertificateContext failed : 0x87d00215   OSDDownloadContent  6/30/2023 1:26:09 PM    752 (0x02F0)
CCMRetrieveCertificateContext(eType, ppTmpContext), HRESULT=87d00215 (K:\dbs\sh\cmgm\0405_083130\cmd\0\src\Framework\security\MsgAuth\CCMGenCert\ccmgencert.cpp,3454)   OSDDownloadContent  6/30/2023 1:26:09 PM    752 (0x02F0)
CCMGetCurrentCertificateContext(eCertMsgAuthSignature, ppCertContext), HRESULT=87d00215 (K:\dbs\sh\cmgm\0405_083130\cmd\0\src\Framework\security\MsgAuth\CCMGenCert\ccmgencert.cpp,3511)    OSDDownloadContent  6/30/2023 1:26:09 PM    752 (0x02F0)
pSigningCertContext != NULL, HRESULT=80004005 (K:\dbs\sh\cmgm\0405_083130\cmd\15\src\Framework\TSCore\utils.cpp,7444)   OSDDownloadContent  6/30/2023 1:26:09 PM    752 (0x02F0)
Signing certificate context is NOT defined. OSDDownloadContent  6/30/2023 1:26:09 PM    752 (0x02F0)
PrepareTransportEx() failed. 0x80004005.    OSDDownloadContent  6/30/2023 1:26:09 PM    752 (0x02F0)
TS::Utility::PrepareTransport(oHttpTransport), HRESULT=80004005 (K:\dbs\sh\cmgm\0405_083130\cmd\15\src\Framework\TSCore\resolvesource.cpp,4788) OSDDownloadContent  6/30/2023 1:26:09 PM    752 (0x02F0)
Failed to download content for SMS package XXX00905, hr=0x80004005  OSDDownloadContent  6/30/2023 1:26:09 PM    752 (0x02F0)
Failed to resolve the source for Package: XXX00905, hr=0x80004005   OSDDownloadContent  6/30/2023 1:26:09 PM    752 (0x02F0)
Failed to download package XXX00905, cannot continue (0x80004005)   OSDDownloadContent  6/30/2023 1:26:09 PM    752 (0x02F0)
Signing Certificate is not available in the store   RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
CCMRetrieveCertificateContext(eType, ppTmpContext), HRESULT=87d00215 (K:\dbs\sh\cmgm\0405_083130\cmd\0\src\Framework\security\MsgAuth\CCMGenCert\ccmgencert.cpp,3454)   RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
CCMGetCurrentCertificateContext(eCertMsgAuthSignature, ppCertContext), HRESULT=87d00215 (K:\dbs\sh\cmgm\0405_083130\cmd\0\src\Framework\security\MsgAuth\CCMGenCert\ccmgencert.cpp,3511)    RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
pSigningCertContext != NULL, HRESULT=80004005 (K:\dbs\sh\cmgm\0405_083130\cmd\15\src\Framework\TSCore\utils.cpp,7444)   RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
TS::Utility::PrepareTransport(oHttpTransport), HRESULT=80004005 (K:\dbs\sh\cmgm\0405_083130\cmd\15\src\Framework\TSCore\resolvesource.cpp,4788) RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
CCMRetrieveCertificateContext failed : 0x87d00215   RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Signing certificate context is NOT defined. RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
PrepareTransportEx() failed. 0x80004005.    RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Failed to download content for SMS package XXX00905, hr=0x80004005  RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Failed to resolve the source for Package: XXX00905, hr=0x80004005   RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Failed to download package XXX00905, cannot continue (0x80004005)   RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
Process completed with exit code 1  RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
PowerShell command line returned code 1 RunPowerShellScript 6/30/2023 1:26:09 PM    1372 (0x055C)
ReleaseSource() for C