Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invoke-CMApplyDriverPackage.ps1 not using $FallBackSKU #202

Open
CornHead764 opened this issue Dec 20, 2019 · 20 comments
Open

Invoke-CMApplyDriverPackage.ps1 not using $FallBackSKU #202

CornHead764 opened this issue Dec 20, 2019 · 20 comments
Assignees

Comments

@CornHead764
Copy link

So I was attempting to use this script on a Dell Optiplex 7010, and the script kept failing. Looking at the logs, below is what it was detecting:

-Manufacturer determined as: Dell
-Computer model determined as: OptiPlex 7010
-Computer SKU determined as: OptiPlex 7010
-Fallback SKU determined as: 0577

After this, once it finds the 7010 driver package, we see this in the logs:

-Attempting to find a match for driver package: Drivers - Dell OptiPlex 7010 - Windows 10 x64
-Unable to match computer model using detection method: SystemSKU (OptiPlex 7010)
-Fallback from SystemSKU match found for computer model instead using detection method: SystemSKU
-Driver package does not meet computer model, manufacturer and operating system and architecture criteria: Drivers - Dell OptiPlex 7010 - Windows 10 x64

So we can see the script detects the SKU as a fallback, and the model as the SKU. I didn't dig into the SKU detection logic, but figured I'd look at the fallback, as if it's detecting that, it should still work. Looking at the script, there are only 3 references to the $FallBackSKU variable. and those are as follows:

Line 598: $FallBackSKU = [regex]::Matches($OEMString, '\[\S*]')[0].Value.TrimStart("[").TrimEnd("]")

Line 610-612:
if (-not ([string]::IsNullOrEmpty($FallBackSKU))) { Write-CMLogEntry -Value "Fallback SKU determined as: $FallBackSKU" -Severity 1 }

So really, the variable is detected, filled, and logged, but never used.

To make it work, I simply added a clause to the if statement on line 813, which now reads:
if (($Package.PackageManufacturer -match $ComputerManufacturer) -and ($Package.PackageName -match $OSName) -and ($Package.PackageName -match $OSImageArchitecture) -and (($Package.PackageDescription -match $SystemSKU) -or ($Package.PackageDescription -match $FallBackSKU))) {

The change is the statement after the last -and. Previously, it didn't reference the $FallBackSKU variable, but now that it does, if either the $SystemSKU or $FallBackSKU are in the package description (which was already the case with the 7010), then the statement will evaluate as true.

This worked as a fix at 4:45, so there may be a better way to fix this, but that's what I found that worked for my scenario. Please let me know if you need any additional information, validation, or testing.

@timothyd09
Copy link

Having this same issue and I simply commented out the validation "(($Package.PackageDescription -match $SystemSKU)" as it has already been evaluated in the previous section so I didn't feel it needed to be evaluated again.

@celadyn
Copy link

celadyn commented Feb 27, 2020

Having the same issue with a Dell Optiplex 7010. Both model and SKU (0577) detection fail and no drivers are installed. About to dive into the script and make some change similar to the above commenters :) wonder why it's just this one that fails? No other model appears to generate the same behavior (that I've seen).

Manufacturer determined as: Dell
Computer model determined as: OptiPlex 7010
Computer SKU determined as: OptiPlex 7010
Fallback SKU determined as: 0577
...
Attempting to find a match for driver package: Drivers - Dell Optiplex 7010 - Windows 10 x64   (CCM00C03)
Unable to match computer model using detection method: SystemSKU (OptiPlex 7010)
Fallback from SystemSKU match found for computer model instead using detection method: SystemSKU (OptiPlex 7010)
Driver package does not meet computer model, manufacturer and operating system and architecture criteria: Drivers - Dell Optiplex 7010 - Windows 10 x64 (CCM00C03)

@NickolajA
Copy link
Member

Could you please try the 3.0.0 version of the script to see if the UseDriverFallback parameter and functionality works better for you?

https://github.com/SCConfigMgr/ConfigMgr/blob/master/Operating%20System%20Deployment/Drivers/Invoke-CMApplyDriverPackage_3.0.0_Preview.ps1

@NickolajA
Copy link
Member

Any update?

@NickolajA NickolajA self-assigned this Mar 21, 2020
@shaylesh
Copy link

Hi Nickolaj,

Is the Dell Optiplex 7010 issue fixed in version 3.0.0 ? I am facing exactly same issue.

@NickolajA
Copy link
Member

Use the new improved DebugMode where you can test if any model will match the correct driver package. An example is on our docs page on the blog. I can't remember this specific issue though.

@agrooms
Copy link

agrooms commented Mar 23, 2020

The Dell Optiplex 3020M exhibits the same behavior

@NickolajA
Copy link
Member

Could you share the full ApplyDriverPackage.log from that model?

@agrooms
Copy link

agrooms commented Mar 23, 2020 via email

@agrooms
Copy link

agrooms commented Mar 23, 2020

ApplyDriverPackage.zip

@agrooms
Copy link

agrooms commented Mar 23, 2020

I can confirm the same on the Dell Optiplex 7010 as reported earlier. I can force the update again and pull that log if would help.

@NickolajA
Copy link
Member

That's not using the latest version 3.0.0, it's using version 2.2.7. Could you test with the new, please? A lot of the logic has been re-written.

@agrooms
Copy link

agrooms commented Mar 23, 2020 via email

@NickolajA
Copy link
Member

No worries, it's actually not in Preview anymore. Was released this weekend!

@agrooms
Copy link

agrooms commented Mar 23, 2020 via email

@NickolajA
Copy link
Member

Great to hear! Looking forward to the results from the other model.

@agrooms
Copy link

agrooms commented Mar 24, 2020 via email

@timothyd09
Copy link

timothyd09 commented Mar 24, 2020 via email

@agrooms
Copy link

agrooms commented Mar 24, 2020

Sorry to be a pain in the butt. I am expanding my testing and am finding that my HP 840 laptops are not working now. The script seems to find the appropriate manufacturer and model and sees that there are two driver packages but then abort. See attached log file. Thanks in advance for your support and assistance.

@agrooms
Copy link

agrooms commented Mar 24, 2020

ApplyDriverPackage.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants