MSEndpointMgr / ConfigMgr

Microsoft Endpoint Configuration Manager scripts and tools
628 stars 282 forks source link

command line returned code 9 when Invoke-CMApplyDriverPackage.ps1 #298

Open CABraunIV opened 3 years ago

CABraunIV commented 3 years ago

In Task Sequence using Dynamically Apply Drivers as below: -URI "http://mysccmserver/configmgrwebservice/configmgr.asmx" -SecretKey "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -Filter "Driver"

Task Sequence Log Error: The task sequence execution engine failed executing the action (Dynamically Apply Drivers) in the group (Install Operating System) with the error code 9 Action output: ... CMApplyDriverPackage.ps1 range 0-68020 Downloaded file from http://MySecondaryDP:80/SMS_DP_SMSPKG$/SC2001BF/sccm?/Invoke-CMApplyDriverPackage.ps1 to C:_SMSTaskSequence\Packages\SC2001BF\Invoke-CMApplyDriverPackage.ps1 VerifyContentHash: Hash algorithm is 32780 Content successfully downloaded at C:_SMSTaskSequence\Packages\SC2001BF. Resolved source to 'C:_SMSTaskSequence\Packages\SC2001BF' Working dir 'C:_SMSTaskSequence\Packages\SC2001BF' Command line for extension .exe is "%1" %* Set command line: Run PowerShell Script PowerShell command line is NOT shown in the log ('OSDLogPowerShellParameters' is NOT set to 'True') Executing command line: Run PowerShell Script with options (0, 4) Process completed with exit code 9 PowerShell command line returned code 9 ReleaseSource() for C:_SMSTaskSequence\Packages\SC2001BF. reference count 1 for the source C:_SMSTaskSequence\Packages\SC2001BF before releasing Released the resolved source C:_SMSTaskSequence\Packages\SC2001BF. The operating system reported error 9: The storage control block address is invalid.

The ApplyDriverPackage log contains the following: <![LOG[===== SCConfigMgr Invoke-CMApplyDriverPackage Version 2.2.3 ====]LOG]!> <![LOG[Driver download package process initiated]LOG]!> <![LOG[Manufacturer determined as: Hewlett-Packard]LOG]!> <![LOG[Computer model determined as: HP ProDesk 600 G4 DM (TAA)]LOG]!> <![LOG[Computer SKU determined as: 83EF]LOG]!> <![LOG[Retrieved a total of 33 driver packages from web service]LOG]!> <![LOG[Attempting to detect OS Image data from task sequence, running in DeploymentType: BareMetal]LOG]!> <![LOG[Multiple OS Image objects detected and OSImageTSVariableName was not specified. Selecting the first OS Image object from web service call]LOG]!> <![LOG[Translated OSName from OSImageVersion: Windows 10]LOG]!> <![LOG[Translated OSVersion from OSImageVersion: ]LOG]!> <![LOG[Translated OSImageArchitecture: x64]LOG]!> <![LOG[Using computer detection method: SystemSKU]LOG]!> <![LOG[Attempting to find a match for driver package: Script - Dynamically Apply Drivers (SC2001BF)]LOG]!> <![LOG[Unable to match computer model using detection method: SystemSKU (83EF)]LOG]!> <![LOG[Driver package does not meet computer model, manufacturer and operating system and architecture criteria: Script - Dynamically Apply Drivers (SC2001BF)]LOG]!> <![LOG[Computer model detection logic failed for all detected driver packages]LOG]!>

I think maybe the (TAA) that is part of the Computer Model is not being interpreted correctly as the drive package as downloaded via the Driver Automation Tool does not have a model with (TAA) in the name.

Any thoughts on how I can get this working again? I have updated the Invoke-CMApplyDrivePackage.ps1 to 3.1.0 but that didn't resolve the issue. In fact that is now generating a different error which I will make a different post about.

EDIT-1) Based on some other things that I have read, I would like to add that I recently added the option of Windows 10 20H2 as an OS available for deployment to the task sequence. So there are 2 Windows 10 versions available in the TS for our Service Center that handles OSD operations to choose from. 1809 and 20H2. I have looked back through the logs of OSD's prior to adding 20H2 and the "Dynamically Apply Drivers" step was successful even on these devices with (TAA) in the model name.

So I now think that this is nothing to do with (TAA) in the name but seems more linked with the addition of 20H2 wim in the task sequence along with 1809.

I added 20H2 as an option for when our SC folks are imaging HP Probook 640 G8 because I could not find 1809 drivers for that machine type using the driver automation tool. So I downloaded the 2004 driver pack (the most recent version available) using the driver automation tool and added a 20H2 OS option for them to choose when deploying one of these new laptops.

Am I missing something that I need to do since adding a 2nd OS possibility?

CABraunIV commented 3 years ago

I have opted to create 2 task sequences for OSD. One for 1809 and the other for 20H2. Both only contain their specific OS for the apply OS step so there is no longer multiple OSes referenced in the task sequence. However when deploying 1809 the Dynamically Apply Drivers step is still failing.

The error is:

The task sequence execution engine failed executing the action (Dynamically Apply Drivers) in the group (Install Operating System) with the error code 1 Action output: ... plyDriverPackage.ps1 range 0-101148 Downloaded file from http://SCCM-FQDN:80/SMS_DP_SMSPKG$/SC2001BF/sccm?/Invoke-CMApplyDriverPackage.ps1 to C:_SMSTaskSequence\Packages\SC2001BF\Invoke-CMApplyDriverPackage.ps1 VerifyContentHash: Hash algorithm is 32780 Content successfully downloaded at C:_SMSTaskSequence\Packages\SC2001BF. Resolved source to 'C:_SMSTaskSequence\Packages\SC2001BF' Working dir 'C:_SMSTaskSequence\Packages\SC2001BF' Command line for extension .exe is "%1" %* Set command line: Run PowerShell Script PowerShell command line is NOT shown in the log ('OSDLogPowerShellParameters' is NOT set to 'True') Executing command line: Run PowerShell Script with options (0, 4) Process completed with exit code 1 PowerShell command line returned code 1 ReleaseSource() for C:_SMSTaskSequence\Packages\SC2001BF. reference count 1 for the source C:_SMSTaskSequence\Packages\SC2001BF before releasing Released the resolved source C:_SMSTaskSequence\Packages\SC2001BF. The operating system reported error 1: Incorrect function.

Again, the command parameters I am running are: -URI "http://SCCM-FQDN/configmgrwebservice/configmgr.asmx" -SecretKey "My-Secret-Key-Here" -Filter "Drivers"

Why, all of a sudden are these 1809 machines no longer able to successfully run the dynamically apply drivers step?

CABraunIV commented 3 years ago

Here is the ApplyDriverPackage.log from a recent failure of a new desktop with 1809 (The next to last line says that this should not be happening and to contact the script developers.)

<![LOG[[ApplyDriverPackage]: Apply Driver Package process initiated]LOG]!> <![LOG[ - Apply driver package deployment type: BareMetal]LOG]!> <![LOG[ - Apply driver package operational mode: Production]LOG]!> <![LOG[[PrerequisiteChecker]: Starting environment prerequisite checker]LOG]!> <![LOG[ - Supported computer platform detected, script execution allowed to continue]LOG]!> <![LOG[ - Computer manufacturer determined as: HP]LOG]!> <![LOG[ - Computer model determined as: HP ProDesk 600 G4 DM (TAA)]LOG]!> <![LOG[ - Computer SystemSKU determined as: 83EF]LOG]!> <![LOG[ - Computer model detection was successful]LOG]!> <![LOG[ - Computer SystemSKU detection was successful]LOG]!> <![LOG[ - Computer details successfully verified]LOG]!> <![LOG[ - Determined primary computer detection method: SystemSKU]LOG]!> <![LOG[[PrerequisiteChecker]: Completed environment prerequisite checker]LOG]!> <![LOG[[WebService]: Starting ConfigMgr WebService phase]LOG]!> <![LOG[ - Successfully connected to ConfigMgr WebService at URI: http://MYSCCMSERVER/configmgrwebservice/configmgr.asmx]LOG]!> <![LOG[ - Retrieved a total of '33' driver packages from web service matching operational mode: Production]LOG]!> <![LOG[ - Attempting to detect OS Image data from task sequence with PackageID: SC2001ED]LOG]!> <![LOG[ - Target operating system name detected as: Windows 10]LOG]!> <![LOG[ - Target operating system architecture detected as: x64]LOG]!> <![LOG[ - Target operating system build version detected as: 10.0.17763.437]LOG]!> <![LOG[ - Target operating system translated version detected as: 1809]LOG]!> <![LOG[[WebService]: Completed ConfigMgr WebService phase]LOG]!> <![LOG[[DriverPackage]: Starting driver package matching phase]LOG]!> <![LOG[ - Initial count of driver packages before starting filtering process: 33]LOG]!> <![LOG[ - Filtering driver package results to detected computer manufacturer: HP]LOG]!> <![LOG[ - Count of driver packages after filter processing: 30]LOG]!> <![LOG[ - Filtering driver package results to only include packages that have details added to the description field]LOG]!> <![LOG[ - Count of driver packages after filter processing: 30]LOG]!> <![LOG[[DriverPackage:SC2001D5]: Processing driver package with 4 detection methods: Drivers - HP Elite x2 1011 G1 Tablet with Power Keyboard - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC20019F]: Processing driver package with 4 detection methods: Drivers - HP EliteBook 840 G1 Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC20019E]: Processing driver package with 4 detection methods: Drivers - HP EliteBook 850 G1 Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC2001C3]: Processing driver package with 4 detection methods: Drivers - HP EliteBook Folio 1040 G2 Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC20018E]: Processing driver package with 4 detection methods: Drivers - HP EliteBook x360 1030 G2 Base Model - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC200194]: Processing driver package with 4 detection methods: Drivers - HP EliteBook x360 1030 G3 Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC2001CF]: Processing driver package with 4 detection methods: Drivers - HP EliteBook x360 1030 G4 Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC2001BD]: Processing driver package with 4 detection methods: Drivers - HP EliteBook x360 830 G6 Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC200193]: Processing driver package with 4 detection methods: Drivers - HP EliteDesk 800 65W G2 Desktop Mini PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC200195]: Processing driver package with 4 detection methods: Drivers - HP EliteDesk 800 65W G3 Desktop Mini PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC200192]: Processing driver package with 4 detection methods: Drivers - HP EliteDesk 800 65W G4 Desktop Mini PC - Windows 10 1809 x64]LOG]!> <![LOG[ - Matched SystemSKU: 83EF]LOG]!> <![LOG[ - Matched operating system name: Windows 10]LOG]!> <![LOG[ - Matched operating system architecture: x64]LOG]!> <![LOG[ - Matched operating system version: 1809]LOG]!> <![LOG[[DriverPackage:SC200192]: Driver package was created on: 05/22/2019 16:41:39]LOG]!> <![LOG[[DriverPackage:SC200192]: Match found between driver package and computer for 4/4 checks, adding to list for post-processing of matched driver packages]LOG]!> <![LOG[[DriverPackage:SC200187]: Processing driver package with 4 detection methods: Drivers - HP EliteDesk 800 G3 Small Form Factor PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC200190]: Processing driver package with 4 detection methods: Drivers - HP EliteDesk 800 G4 Small Form Factor PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC200196]: Processing driver package with 4 detection methods: Drivers - HP ProBook 450 G4 Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC20018D]: Processing driver package with 4 detection methods: Drivers - HP ProBook 450 G5 Base Model Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC20018A]: Processing driver package with 4 detection methods: Drivers - HP ProBook 450 G6 Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC2001D0]: Processing driver package with 4 detection methods: Drivers - HP ProBook 450 G7 Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC2001E7]: Processing driver package with 4 detection methods: Drivers - HP ProBook 640 G8 Notebook PC - Windows 10 2004 x64]LOG]!> <![LOG[[DriverPackage:SC200186]: Processing driver package with 4 detection methods: Drivers - HP ProBook 650 G2 Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[ - Matched SystemSKU: 83EF]LOG]!> <![LOG[ - Matched operating system name: Windows 10]LOG]!> <![LOG[ - Matched operating system architecture: x64]LOG]!> <![LOG[ - Matched operating system version: 1809]LOG]!> <![LOG[[DriverPackage:SC200186]: Driver package was created on: 05/22/2019 15:22:21]LOG]!> <![LOG[[DriverPackage:SC200186]: Match found between driver package and computer for 4/4 checks, adding to list for post-processing of matched driver packages]LOG]!> <![LOG[[DriverPackage:SC20018B]: Processing driver package with 4 detection methods: Drivers - HP ProBook 650 G3 Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC20018C]: Processing driver package with 4 detection methods: Drivers - HP ProBook 650 G3 Quad Core Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC200189]: Processing driver package with 4 detection methods: Drivers - HP ProBook 650 G4 Notebook PC - Windows 10 1809 x64]LOG]!> <![LOG[ - Matched SystemSKU: 83EF]LOG]!> <![LOG[ - Matched operating system name: Windows 10]LOG]!> <![LOG[ - Matched operating system architecture: x64]LOG]!> <![LOG[ - Matched operating system version: 1809]LOG]!> <![LOG[[DriverPackage:SC200189]: Driver package was created on: 05/22/2019 15:42:14]LOG]!> <![LOG[[DriverPackage:SC200189]: Match found between driver package and computer for 4/4 checks, adding to list for post-processing of matched driver packages]LOG]!> <![LOG[[DriverPackage:SC2001EB]: Processing driver package with 4 detection methods: Drivers - HP ProDesk 600 G4 Desktop Mini PC - Windows 10 1809 x64]LOG]!> <![LOG[ - Matched SystemSKU: 83EF]LOG]!> <![LOG[ - Matched operating system name: Windows 10]LOG]!> <![LOG[ - Matched operating system architecture: x64]LOG]!> <![LOG[ - Matched operating system version: 1809]LOG]!> <![LOG[[DriverPackage:SC2001EB]: Driver package was created on: 12/28/2020 09:51:20]LOG]!> <![LOG[[DriverPackage:SC2001EB]: Match found between driver package and computer for 4/4 checks, adding to list for post-processing of matched driver packages]LOG]!> <![LOG[[DriverPackage:SC20018F]: Processing driver package with 4 detection methods: Drivers - HP Z2 Mini G3 Workstation - Windows 10 1809 x64]LOG]!> <![LOG[ - Matched SystemSKU: 83EF]LOG]!> <![LOG[ - Matched operating system name: Windows 10]LOG]!> <![LOG[ - Matched operating system architecture: x64]LOG]!> <![LOG[ - Matched operating system version: 1809]LOG]!> <![LOG[[DriverPackage:SC20018F]: Driver package was created on: 05/22/2019 16:26:45]LOG]!> <![LOG[[DriverPackage:SC20018F]: Match found between driver package and computer for 4/4 checks, adding to list for post-processing of matched driver packages]LOG]!> <![LOG[[DriverPackage:SC200188]: Processing driver package with 4 detection methods: Drivers - HP Z2 Mini G4 Workstation - Windows 10 1809 x64]LOG]!> <![LOG[ - Matched SystemSKU: 83EF]LOG]!> <![LOG[ - Matched operating system name: Windows 10]LOG]!> <![LOG[ - Matched operating system architecture: x64]LOG]!> <![LOG[ - Matched operating system version: 1809]LOG]!> <![LOG[[DriverPackage:SC200188]: Driver package was created on: 05/22/2019 15:35:16]LOG]!> <![LOG[[DriverPackage:SC200188]: Match found between driver package and computer for 4/4 checks, adding to list for post-processing of matched driver packages]LOG]!> <![LOG[[DriverPackage:SC2001D4]: Processing driver package with 4 detection methods: Drivers - HP Z2 Tower G4 Workstation - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC2001C9]: Processing driver package with 4 detection methods: Drivers - HP Z240 Tower Workstation - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC200185]: Processing driver package with 4 detection methods: Drivers - HP ZBook 15u G4 Mobile Workstation - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC200184]: Processing driver package with 4 detection methods: Drivers - HP ZBook 15u G5 Mobile Workstation - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage:SC2001CE]: Processing driver package with 4 detection methods: Drivers - HP ZBook 15u G6 Mobile Workstation - Windows 10 1809 x64]LOG]!> <![LOG[[DriverPackage]: Completed driver package matching phase]LOG]!> <![LOG[[DriverPackageValidation]: Starting driver package validation phase]LOG]!> <![LOG[ - Amount of driver packages detected by validation process: 6]LOG]!> <![LOG[ - WARNING: Computer detection method is currently 'SystemSKU', and multiple packages have been matched but with different SystemSKU value]LOG]!> <![LOG[ - WARNING: This should not be a possible scenario, please reach out to the developers of this script]LOG]!> <![LOG[[ApplyDriverPackage]: Apply Driver Package process failed, please refer to previous error or warning messages]LOG]!>