MSEndpointMgr / ConfigMgr

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

Invoke-CMApplyDriverPackage - picking incorrect driver when multiple version matches #176

Open PeterDodemont opened 5 years ago

PeterDodemont commented 5 years ago

Hi,

Driver matching seems to pick the latest drivers added rather than the drivers with the highest version number when there are multiple matches. I initially added Surface drivers for 1903 for testing purposes and then added 1803 drivers once initial testing was complete. And now even devices with 1903 are getting the drivers for 1803 installed. See below log where it matches fully with Windows 10 1903 and then later partially with Windows 10 1803. But it then picks 1803 because that package was added after the 1903 package.

EDIT: This is from a driver upgrade within the OS using the "-DeploymentType DriverUpdate" switch.

<![LOG[===== SCConfigMgr Invoke-CMApplyDriverPackage Version 2.2.3 ====]LOG]!> <![LOG[Driver download package process initiated]LOG]!> <![LOG[Manufacturer determined as: Microsoft]LOG]!> <![LOG[Computer model determined as: Surface Pro 6]LOG]!> <![LOG[Unable to determine system SKU value]LOG]!> <![LOG[Retrieved a total of 9 driver packages from web service]LOG]!> <![LOG[Translated OSName from OSImageVersion: Windows 10]LOG]!> <![LOG[Translated OSVersion from OSImageVersion: 1903]LOG]!> <![LOG[Translated OSImageArchitecture: x64]LOG]!> <![LOG[Using computer detection method: ComputerModel]LOG]!> <![LOG[Attempting to find a match for driver package: Drivers - Microsoft Surface Pro 4 - Windows 10 1903 x64 (NSW0005C)]LOG]!> <![LOG[Driver package does not meet computer model criteria: Drivers - Microsoft Surface Pro 4 - Windows 10 1903 x64 (NSW0005C)]LOG]!> <![LOG[Attempting to find a match for driver package: Drivers - Microsoft Surface Pro 5 - Windows 10 1903 x64 (NSW0005D)]LOG]!> <![LOG[Driver package does not meet computer model criteria: Drivers - Microsoft Surface Pro 5 - Windows 10 1903 x64 (NSW0005D)]LOG]!> <![LOG[Attempting to find a match for driver package: Drivers - Microsoft Surface Pro 6 - Windows 10 1903 x64 (NSW0005E)]LOG]!> <![LOG[Match found for computer model using detection method: ComputerModel (Surface Pro 6)]LOG]!> <![LOG[Attempting to match driver package name with OS name 'Windows 10' and version 1903 for Microsoft]LOG]!> <![LOG[Match found for manufacturer, operating system and architecture: Drivers - Microsoft Surface Pro 6 - Windows 10 1903 x64 (NSW0005E)]LOG]!> <![LOG[Adding driver package to list of packages to process]LOG]!> <![LOG[Attempting to find a match for driver package: Drivers - Microsoft Surface Pro 4 - Windows 10 1803 x64 (NSW0005F)]LOG]!> <![LOG[Driver package does not meet computer model criteria: Drivers - Microsoft Surface Pro 4 - Windows 10 1803 x64 (NSW0005F)]LOG]!> <![LOG[Attempting to find a match for driver package: Drivers - Microsoft Surface Pro 5 - Windows 10 1803 x64 (NSW00060)]LOG]!> <![LOG[Driver package does not meet computer model criteria: Drivers - Microsoft Surface Pro 5 - Windows 10 1803 x64 (NSW00060)]LOG]!> <![LOG[Attempting to find a match for driver package: Drivers - Microsoft Surface Pro 6 - Windows 10 1803 x64 (NSW00061)]LOG]!> <![LOG[Match found for computer model using detection method: ComputerModel (Surface Pro 6)]LOG]!> <![LOG[Unable to match driver package name with OS version '1903', falling back to match found for 'Windows 10']LOG]!> <![LOG[Match found for manufacturer, operating system and architecture: Drivers - Microsoft Surface Pro 6 - Windows 10 1803 x64 (NSW00061)]LOG]!> <![LOG[Adding driver package to list of packages to process]LOG]!> <![LOG[Driver package list contains multiple matches, attempting to download driver package content based upon latest package creation date]LOG]!> <![LOG[Attempting to download driver package NSW00061 content from Distribution Point]LOG]!>

king-matthew-g commented 4 years ago

Proposed fix that has been tested and confirmed working. May want to change default from freshest to highest build number but would require additional logic in case no build specific driver packs were found.

image

nclinch commented 4 years ago

I would suggest adding another switch to the script where you can specify OS version. That way you can be sure you get the right version to match the OS version you are installing

NickolajA commented 4 years ago

It's being redone in the upcoming version that's out very soon.