I was thinking about my drivers folder and helping people to organise their drivers and I remembered Chris Nackers and Johan Arwidmark had posted scripts to help import drivers into MDT.
I’ve created a script that can be used to generate a driver repository folder structure on a hard drive or network share. The structure is in a format useful to MDT and SCCM.
This screenshot shows a recommended tree structure for organising your drivers.
The structure allows you to separate architecture, OS and models in order to organise drivers and better leverage Selection Profiles within MDT. Another tip is to use the exact make and model descriptions from WMI so you can use variables to target your driver selection.
Thanks to Andy Sibthorp for spotting an obvious flaw in the original code. Here’s my script:
Param(
$Folder="C:\Downloads\Drivers",
$archs = "x86","x64",
$OSs = "Windows PE","Windows XP","Windows 7","Windows 8",
$Makes = "Dell Inc.","Hewlett-Packard","Microsoft Corporation","VMware, Inc"
)
foreach ($arch in $archs) {
foreach ($OS in $OSs) {
foreach ($make in $Makes) {
New-Item -path "$Folder\$OS $arch" -Name "$Make" -Type directory
}
}
}
There are 4 Variables that can be edited to include/exclude OS or Models etc.
The full code is below and in the script repository here.
<#
.SYNOPSIS
Create a Driver Repository for SCCM and MDT drivers.
.DESCRIPTION
The Create-DriverStore.ps1 script will create a folder then populate it with empty subfolders suitable for driver storage.
.PARAMETER Folder
Specifies the path where the folder structure will be created.
.PARAMETER archs
List the architecture(s) that you will be deploying to
.PARAMETER OSs
List the Operating Systems that you will be deploying within your Enterprise
.PARAMETER Makes
List all the Manufacturers of Computers within your organisation
.EXAMPLE
Create-DriverStore.ps1
This will create a New Driver repository in the default recomended location
.EXAMPLE
Create-DriverStore.ps1 -Folder C:\DriverStore
This will create a New Driver repository in C:\DriverStore
.EXAMPLE
Create-DriverStore.ps1 -Folder C:\Downloads\Drivers -archs x86 -OSs "Windows PE","Windows 8" -Makes "Dell Inc.", "VMWare"
This will create a New Driver repository in C:\Downloads\Drivers for x86 Architecture for Windows PE and Windows 8 for models Dell and VMware
.NOTES
Author: Andrew Barnes
Date: 4 June 2012
Version Control:
16 November 2012 - Fixed parameter block
.LINK
Online version: https://scriptimus.wordpress.com
#>
Param (
[String[]]$Folder=("C:\Downloads\Drivers"),
[String[]]$archs = ("x86","x64"),
[String[]]$OSs = ("Windows PE","Windows XP","Windows 7"),
[String[]]$Makes = ("Dell Inc.","Hewlett-Packard","Microsoft Corporation","VMware, Inc")
)
Begin{}
Process{
foreach ($arch in $archs) {
foreach ($OS in $OSs) {
foreach ($make in $Makes) {
New-Item -path "$Folder\$OS $arch" -Name "$Make" -Type directory
}
}
}
}
End{}
My next post will contain my script for importing drivers from this store into MDT. Enjoy.
The script is self documenting, open a Powershell Console and type:
Get-Help .\Create-DriverStore.ps1 -Examples
This will show the usage examples like below.
————————– EXAMPLE 1 ————————–
C:\PS>Create-DriverStore.ps1
This will create a New Driver repository in the default recomended location
————————– EXAMPLE 2 ————————–
C:\PS>Create-DriverStore.ps1 -Folder C:\DriverStore
This will create a New Driver repository in C:\DriverStore
————————– EXAMPLE 3 ————————–
C:\PS>Create-DriverStore.ps1 -Folder C:\Downloads\Drivers -archs x86 -OSs “Windows PE”,”Windows 8″ -Makes “Dell Inc.”, “VMWare”
This will create a New Driver repository in C:\Downloads\Drivers for x86 Architecture for Windows PE and Windows 8 for models Dell and VMware







After a Sysprep operation, Hardware is detected and devices reinstall all their drivers. This behaviour is to by design and to be expected.
