MSEndpointMgr / ModernDriverManagement

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

Lenovo - multiple packages have been matched but with different SystemSKU #235

Open mbowdenDGX opened 1 year ago

mbowdenDGX commented 1 year ago

I am using the latest 4.2.1 script but running into a problem with the Lenovo M75Q Gen2 model. Yes, we have two M75Q Gen 2 models with different SKU (11JN, 11JM) for both Windows 10 21H2 and Windows 11 22H2. The script detects the correct driver package (11JN) by SKU, OS, Architecture and OS Version. however it then also picks up the other (11JM) by Model, OS, Architecture and OS Version. It needs to have SKU as the deciding factor, but instead it errors out with this...

DJ12220 commented 1 year ago

I've just bodged this for one of our Fujitsu models that have different SystemSKUs for one model (due to one being 6th gen the other 7th)

Find this:

# Filter out driver packages that does not match with the vendor
Write-CMLogEntry -Value " - Filtering driver package results to detected computer manufacturer: $($ComputerData.Manufacturer)" -Severity 1
$DriverPackages = $DriverPackages | Where-Object {
$_.Manufacturer -like $ComputerData.Manufacturer
}

This appears twice, the other part for driver fallback I think (Don't use it so this isn't triggered)

Below this I have added (Probs no harm adding it to both locations):

# Filter out driver packages that does not match with the SystemSKU
Write-CMLogEntry -Value " - Filtering driver package results to detected computer SystemSKU: $($ComputerData.SystemSKU)" -Severity 1
$DriverPackages = $DriverPackages | Where-Object {
$_.Description -match "$($ComputerData.SystemSKU)"
}

This will need the SystemSKU being somewhere in the comments of your SCCM package, I only use custom packages, not sure it it's there when you use downloaded packs.

I've ran it in debug mode and with this I no longer get the SKU message and it "applies" the drivers at the end.

Maybe the guys can do this more elegantly than this if they get round to it, I am not a PowerShell expert but can follow through and see what's happening.

I also commented out the manufacturer filter stuff as it seems irrelevant to search for the make, then search that list for the systemsku when searching for just the systemsku will work. I guess there might be a situation where different Manufacturers use the same systemsku so this might not suit all. Seems to work for everything we have, which is mainly Fuji's, Lenovo's and HPs.