Task to check driver support, warning end user if not found in database?
I would like to include a task in manually initiated System image deployments that will prompt an error message that warns the end user (usually a technician) performing the deployment that the system does not appear to be in the driver feed, giving them the option to continue or break off imaging.
It looks like the Display Device Compatibility HTA has this potential but I'm having difficulty locating documentation for it.
It looks like the default task is configured to pass the environmental variable %OS% to it, but that would likely be WINDOWS_NT.
It looks like the default task is configured to pass the environmental variable %OS% to it, but that would likely be WINDOWS_NT.
I played around with driver feed advisory a bit but it doesn't appear to throw an exit error if drivers aren't found for that platform.
Are there any known built-in or community workflows that can accomplish this? Or maybe even a recommended practice?
My fall back plan will likely be a powershell script that checks for the existence of y:\drivers_postinstall\[Manufacturer (any spaces and characters after removed)]\[OS]\[Model] (any spaces and characters before last characters removed)] And then prompts with a continue/abort message if the path isn't found, throwing an exit code if abort is chosen.
2 Comments
[ + ] Show comments
Answers (2)
Please log in to answer
Posted by:
andrew_lubchansky
6 years ago
Utilizing Driver Feed Advisor from within a KBEM built KBE will get you most of what you need. Create a Preinstall Task with:
X:\windows\system32\driverfeed_advisor.exe /kbe /w10
pause
pause
DFA with the /kbe flag will give a message whether the correct folders are present or not. The /w10 flag is to force it to check for a windows 10 driver feed, regardless of what may be already installed. We need the pause in order to stop the deployment so you can read the message. This has the side effect of pausing every deployment though.
The importance of using DFA is that is built to take advantage of the SDAs naming scheme for Driver Feeds, which may not 100% match what you pull manually with another script.
Comments:
-
Thanks, the Driver feed adviser doesn't seem to set an error level if the driver isn't found but I should at-least be able to use the text return to help simplify the generation of the folder path to test. - Kiyolaka 6 years ago
Posted by:
Nico_K
6 years ago
you need to do this manually.
Create a manual script which checks for the device as the feed discovery recognizes it and then check if the drivers_postinstall folder with the correct path is avaiable.
You can find all nessesary under \\SDA\drivers_postinstall\ on your SDA.
Since this is not a bad idea at all you should go to kace.uservoice.com and suggest this as a new feature.
Create a manual script which checks for the device as the feed discovery recognizes it and then check if the drivers_postinstall folder with the correct path is avaiable.
You can find all nessesary under \\SDA\drivers_postinstall\ on your SDA.
Since this is not a bad idea at all you should go to kace.uservoice.com and suggest this as a new feature.
Maybe create a Bat file that will list all drivers in drivers_postinstall into a TXT file. That way, they will have an updated list before starting the Deployment?
I am assuming you do not want them to have access to the Drivers_postinstall share. - Channeler 6 years ago
# Script to check Driver feed for system drivers.
# Allow Target OS input parameter
Param(
[string]$TargetOS
)
$SystemManufacturer = (get-wmiobject win32_computersystem).Manufacturer
$SystemModel = (get-wmiobject win32_computersystem).model
# capture the output of the driver feed advisor as a value
$DriverFeedAdvisorOutput = (&"$ENV:SystemRoot\System32\DriverFeed_Advisor.exe")
# convert the driver feed advisor return into a valid folder structure for the target OS.
$DriverPath = $DriverFeedAdvisorOutput -replace '\\\\SDA|\\\\RSA',"Y:" -replace "windows_10_x64|windows_10_x86","$TargetOS"
if (!(test-path "$DriverPath")){
# Add the windows forms assembly
Add-Type -AssemblyName System.Windows.Forms | Out-Null
# Set up message box form attribute.
$MsgBox = [System.Windows.Forms.MessageBox]
# Set up the message and title values
$Title = "System Drivers not found in Driver Feed"
$Message = "Drivers were not found for $SystemManufacturer $SystemModel for $TargetOS . Select Cancel to abort or OK to continue anyway"
$Decision = $MsgBox::Show($Message,$Title,"OkCancel", "Warning")
If ($Decision -eq "Cancel") {
# Exit with error code of 3
Write-Output "Aborting Task" |Out-Host
exit 3
}
} ELSE {
Write-Output "Drivers were found for $SystemManufacturer $SystemModel" |Out-Host
} - Kiyolaka 6 years ago