Deleting 30000 drivers and re-importing 162 Driver packs

We started noticing our driver packages were really big and consuming a lot of time during OSD. This was due to the bug mentioned in KB3084586

The longer we left it the worse it got!

What happens is any drivers added to the database before the fix will still have issues being re-imported unless they have been deleted before the re-import. So the solution for us was to get rid of every driver then add them back.

There are a few scripts online to import drivers and I merged some together to fit our environment however during testing they would often stop working after a few imports as if powershell wasn't getting a response back. To work around this I used a powershell function called start-job with a timeout so it would move to the next import if it had no response.

Script can be downloaded from Github here

 

To delete all drivers first it's just one line

Get-CMDriver | Remove-CMDriver -force

This took 6 hours in my environment..

OPTIONAL: To set driver packages to high priority run this script
(
modify cd PS1:)

Then modify the sitecode var in the main script (ImportDriver.ps1)

$sitecode = “PS1:”

for each driver package you run the powershell script with parameters

.\ImportDriver.ps1 -DriverPackageName "DELL E7470 WIN10 x64" -DriverSource "\\Server\OSD Drivers\Sources\Windows 10\x64\E7470" -DriverPkgSource "\\Server\OSD Drivers\Windows 10\x64\E7470"

It also creates packages and categories if they don't exist. Also updates the distribution points.

This took 3 days in my environment... If I did this again, I would have imported the WIN7 drivers first as this change impacted 1 business day of imaging.

Update: I've noticed the Intel HD Graphics 5xx drivers must have timed out during the import, we have now imported them manually.

 

There are no comments yet, add one below.

Leave a Comment

Your email address will not be published. Required fields are marked *

*