Driver updates, always a pain! Microsoft are fixing it with the Windows Update drivers in the update rings in Intune, but until that includes Firmware as well it’s best to use the tools available.
Fortunately, both Dell and HP offer utilities to update drivers and they both have command line switches which we can use.
Scripts are all here
To make this easier to deploy with Intune, I like to create folders to organise everything so you will find the install/uninstall commands, a text file with the detection method, an icon and an output folder with the package intunewin file.
For this I’ll run through the source folder with the script
Dell
The install.bat copies the scripts to a new folder on the c:\ drive, runs a ps1 to add a scheduled task and then installs the tool (silently)
if not exist "C:\driversupd\" mkdir C:\driversupd
copy %~dp0runupdate.bat c:\driversupd\runupdate.bat
copy %~dp0schtask.ps1 c:\driversupd\schtask.ps1
Powershell.exe -executionpolicy bypass -File c:\driversupd\schtask.ps1
start "" Dell-Command-Update-Application_8D5MC_WIN_4.3.0_A00_01.exe /s
The powershell script registers a scheduled task to run every 2 weeks and check for updates
#Configure Scheduled Task for driver updates
#Set the action
$action = New-ScheduledTaskAction -Execute 'c:\driversupd\runupdate.bat'
#Set a trigger
$trigger = New-ScheduledTaskTrigger -Weekly -WeeksInterval 2 -DaysOfWeek Friday -At 1pm
#Set a Name
$taskname = "Intune Driver Updates"
#Set a Description
$taskdescription = "Weekly driver update Friday at 13:00"
#Register the Task
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName $taskname -Description $taskdescription
Finally, the runupdate script calls Dell Command update to do a silent install without rebooting
"C:\Program Files (x86)\Dell\CommandUpdate\dcu-cli.exe" /driverinstall -silent -reboot=disable -outputlog="c:\driversupd\log.log"
HP
Similar to Dell, only using HP Image assistant
First, copy the files and install the utility. Watch the arguments here or it will launch the GUI on install
if not exist "C:\driversupd\" mkdir C:\driversupd
mkdir c:\driversupd\hp
copy %~dp0runupdate.bat c:\driversupd\runupdate.bat
copy %~dp0schtask.ps1 c:\driversupd\schtask.ps1
copy %~dp0hpupdate.exe c:\driversupd\hpupdate.exe
Powershell.exe -executionpolicy bypass -File c:\driversupd\schtask.ps1
start "" c:\driversupd\hpupdate.exe /s /e /f c:\driversupd\hp
Create your scheduled task
#Configure Scheduled Task for driver updates
#Set the action
$action = New-ScheduledTaskAction -Execute 'c:\driversupd\runupdate.bat'
#Set a trigger
$trigger = New-ScheduledTaskTrigger -Weekly -WeeksInterval 2 -DaysOfWeek Friday -At 1pm
#Set a Name
$taskname = "Intune Driver Updates"
#Set a Description
$taskdescription = "Weekly driver update Friday at 13:00"
#Register the Task
Register-ScheduledTask -Action $action -Trigger $trigger -TaskName $taskname -Description $taskdescription
And create your update script
c:\driversupd\hp\HPImageAssistant.exe /Action:Install /AutoCleanup /Category:Drivers /Silent
c:\driversupd\hp\HPImageAssistant.exe /Action:Install /AutoCleanup /Category:Firmware /Silent
I’ve chosen not to update BIOS with this one, but it can be done with the inclusion of password files. A full list of options are in the manual
There we go, drivers and firmware no longer an issue!
Since you are using powershell, before line 6, you can add these lines:
cd $ENV:UserProfile\Downloads
wget “https://dl.dell.com/FOLDER07582763M/5/Dell-Command-Update-Application-for-Windows-10_GRVPK_WIN_4.3.0_A00_03.EXE”
Absolutely, but obviously the path would need regularly updating in the install script.
The uninstall for HP is a copy of Dell on github.
Thank you, well spotted! Have fixed it now (and re-packaged into Intunewin too)
I’m testing and being prompted for admin credentials once the task runs – any ideas? my users are not local admin.
Did you deploy the script in the system context? Can you check which user the scheduled task is running under? It should be on the SYSTEM user to avoid prompting