MSEndpointMgr / ConfigMgr

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

Surface Models not being detected again #139

Closed itmmdj closed 4 years ago

itmmdj commented 5 years ago

Using version 2.2.3 and tried 2.1.7

Pertinent Portions of the Logs


Manufacturer determined as: Microsoft
Computer model determined as: Surface Book 2
Unable to determine system SKU value
Attempting to detect OS Image data from task sequence, running in DeploymentType: BareMetal Translated OSName from OSImageVersion: Windows 10 Translated OSVersion from OSImageVersion: 1803 Translated OSImageArchitecture: x64 Using computer detection method: ComputerModel


After that it goes through each package on SCCM and doesn't match.


Attempting to find a match for driver package: Drivers - Microsoft Surface Book - Windows 10 1803 x64 (ITM00099) Driver package does not meet computer model criteria: Drivers - Microsoft Surface Book - Windows 10 1803 x64 (ITM00099)


The name of the package that Driver Automation Tool creates is called: "Drivers - Microsoft Surface Book 2 13 - Windows 10 1803 x64"

I have looked through the code and am not smart enough to figure out why it won't match.

itmmdj commented 5 years ago

So i did a some more digging and found that the if statement (which is on line 737) that determines whether or not the system matches the package name of Invoke-CMApplyDriverPackage (version 2.2.3) will result in false.

The variables at runtime are:

$PackageNameComputerModel - Surface Book 2 13 $ComputerModel - Surface Book 2

This results in a false statement due to using the "-like" operator. The issue is that I can't change it to "-match" because that would match more than one package.

Win32_ComputerSystem\SystemSKUNumber has a value of "Surface_Book_1832" in wmi. I am a lousy coder, so I really don't know what to do. It would seem that one would have to make a bunch of entries for each surface model taking from "SystemSKUNumber" and then constructing a string that matches the package names that Driver Automation Tool already creates.

For now I am going to change the package name to

"Drivers - Microsoft Surface Book 2 - Windows 10 1803 x64"

itmmdj commented 5 years ago

It might be easier to read the comments on the package and have the user list the different model numbers there.

NickolajA commented 5 years ago

Yeah I assumed this would happen with the change in the comparison operator switch from "-match" to "-like" when matching those two variables. However, I'd much rather have DAT setting the right model names on the package, instead of dealing with that in the code. I'll speak to Maurice about this, as the comparison operator switch is required for some vendors because of their naming standards.

maurice-daly commented 5 years ago

I've just sent my contact in Microsoft a mail to see if I can get a definitive list of WMI model names. I will then update the XML and get this fixed in the DAT.