|
Post by kn14746 on Sept 14, 2019 6:47:50 GMT
Hi,
Did anyone implement this kind of preflight check with UI++? We have a list of "supported" computer models that have gone through internal testing and validation and they have driver packages available in ConfigMgr. I would like to stop unsupported computer models from passing the preflight check.
|
|
|
Post by Jason on Sept 16, 2019 2:47:25 GMT
This depends on what exactly the list of supported models looks like. A Switch action before the Preflight that sets a variable named something like SUpportedModel to True or False would be the way I would implement this.
|
|
|
Post by Christopher Ireland on Sept 16, 2019 19:10:50 GMT
Yes, like Jason says. I do a Switch action (inside an ActionGroup, so I can truncate it in XMLNotepad 2007) and look for the case-insensitive model name with an InStr command. If found, I set the variable OSDModel with a shortened version of the model name and then use that in the task sequence as the condition for installing the driver, to avoid any WMI calls. If no models are found, the Default case of None tells me that the model isn't supported. Here's an example with a Dell, HP, Lenovo, and Surface:
<ActionGroup Name="Models"> <Action Type="Switch" DontEval="False"> <Case Condition="(InStr(1,"%XHWModel%","Latitude 3570",1) > 0)"> <Variable Name="OSDModel">"Dell3570"</Variable> </Case> <Case Condition="(InStr(1,"%XHWModel%","ProBook 650 G3",1) > 0)"> <Variable Name="OSDModel">"HP650G3"</Variable> </Case> <Case Condition="(InStr(1,"%XHWModel%",""20FRCTO1WW%"",1) > 0)"> <Variable Name="OSDModel">"LENTPX1"</Variable> </Case> <Case Condition="(InStr(1,"%XHWModel%","Surface Pro 4",1) > 0)"> <Variable Name="OSDModel">"MSSP4"</Variable> </Case> <Default> <Variable Name="OSDModel">"None"</Variable> </Default> </Action>
|
|
|
Post by jannisj on Sept 19, 2019 15:04:56 GMT
I've done it like this: <Check Text="Is model %XHWModel% supported:" CheckCondition='"%XHWModel%" = "HP ProDesk 400 G4 DM" OR "%XHWModel%" = "HP EliteDesk 800 G4 TWR"'/> This is just the first 2 models in our list, and it's the easiest way I've found to check for computer model. At the moment our production xml has a line with 65 supported models on it, so interesting to maintain Would be better if we could have a check for %xhwmodel% that matches against a .txt file with 1 model pr.line, and put that file on a webserver. Would be much easier to maintain imho -j
|
|
|
Post by Jason on Oct 2, 2019 1:07:06 GMT
An alternate here then is to use the FileRead action to read a CSV list from a text file. This will place the list into a variable of your choosing. You can then use the InStr VBScript function to look for the local system's model in that CSV list.
You could also just create a variable directly in the XML with the CSV list as well instead of grabbing it from a text file.
|
|
|
Post by kn14746 on Oct 12, 2019 19:22:12 GMT
Thanks. At least for now I implemented this as Christopher suggested.
|
|