FredBainbridge

Removing ConfigMgr Drivers with missing source files

You can find the drivers with missing source files removal script here. This is the second article in a series a driver articles. You can find part 1 here.

Driver management with ConfigMgr can be a bear at times. Without some attention to detail towards organizing your driver source locations it is not uncommon for driver source files to be deleted before the driver is removed from ConfigMgr, by accident or otherwise. This can end up being a real pain in the long run. If source files are missing you can have problems with distributing, deploying drivers as well as maintaining boot images.

Notes

  • An HTML report will be created when the HtmlReport parameter is provided. It defaults to UnusedDrivers.html.
  • This script makes use of the “WhatIf” functionality of PowerShell. Use this if you want to report on missing drivers without deleting them.
  • This heavily utilizes PowerShell verbose output and creates a very detailed transcript file.
  • This requires PowerShell 5.0 or higher.

Usage

Discover what drivers are missing source files but do not delete them. (WhatIf)

.\Remove-FBDriversWIthMissingSource.ps1 -SiteCode LAB -SiteServer localhost -WhatIf -Verbose</pre>

Delete drivers with missing source files.

 

.\Remove-FBDriversWIthMissingSource.ps1 -SiteCode LAB -SiteServer localhost -Verbose

Delete drivers with missing source files and create a html report named “MyUnusedDrivers.html”.

.\Remove-FBDriversWIthMissingSource.ps1 -SiteCode LAB -SiteServer localhost -Verbose -HTMLReport "MyUnusedDrivers.html"

Keep your driver repository clean!


Share