Skip to content

Commit 5b55eb9

Browse files
Add tools for Modern Driver Managment
1 parent 569ec0a commit 5b55eb9

File tree

2 files changed

+110
-0
lines changed

2 files changed

+110
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<#
2+
# This script exports drivers from the machine you are running on, stores them in a folder and create a .CSV file that can be used to
3+
# import custom driver package for the Modern Driver Managment tool. http://www.scconfigmgr.com/modern-driver-management/
4+
#>
5+
6+
Function Export-TSxWindowsDriver {
7+
Param(
8+
$Path,
9+
$Platform,
10+
$WindowsVersion,
11+
$Architecture,
12+
$Version
13+
)
14+
#ExportDriver
15+
$Make = (Get-WmiObject -Class Win32_Computersystem).Manufacturer
16+
switch ($Make)
17+
{
18+
'HP'{
19+
$MakeAlias='Hewlett-Packard'
20+
$ModelAlias = (Get-WmiObject -Class Win32_ComputerSystem).model
21+
$BaseBoard = (Get-CIMInstance -ClassName MS_SystemInformation -NameSpace root\WMI).BaseBoardProduct
22+
}
23+
24+
'Hewlett-Packard'{
25+
$MakeAlias=$Make
26+
$ModelAlias = (Get-WmiObject -Class Win32_ComputerSystem).model
27+
$BaseBoard = (Get-CIMInstance -ClassName MS_SystemInformation -NameSpace root\WMI).BaseBoardProduct
28+
}
29+
30+
'LENOVO'{
31+
$MakeAlias=$Make
32+
$ModelAlias = (Get-WmiObject -Class Win32_ComputerSystemProduct).version
33+
$BaseBoard = ((Get-WmiObject -Class Win32_ComputerSystem | Select-Object -ExpandProperty Model).SubString(0, 4)).Trim()
34+
}
35+
36+
'Microsoft Corporation'{
37+
$MakeAlias='Microsoft'
38+
$ModelAlias = (Get-WmiObject -Class Win32_ComputerSystem).model
39+
$BaseBoard = (Get-WmiObject -Class Win32_ComputerSystem).model
40+
}
41+
Default {}
42+
}
43+
44+
New-Item -Path $Path -ItemType Directory -Force -ErrorAction Stop
45+
New-Item -Path $Path\$MakeAlias -ItemType Directory -Force -ErrorAction Stop
46+
New-Item -Path $Path\$MakeAlias\$ModelAlias -ItemType Directory -Force -ErrorAction Stop
47+
if((Test-Path -Path $Path) -ne $true){"Unable to access exportpath"}
48+
49+
Export-WindowsDriver -Online -Destination $Path\$MakeAlias\$ModelAlias
50+
$items = Get-ChildItem -Path $Path\$MakeAlias\$ModelAlias -Filter PRN*
51+
foreach ($item in $items){
52+
Remove-Item -Path $item.fullname -Recurse -Force
53+
}
54+
55+
$SourceDirectory = "$Path\$MakeAlias\$ModelAlias"
56+
Set-Content -Path $("$Path\$MakeAlias\$ModelAlias.csv") -Value "Make,Model,Baseboard,Platform,Operating System,Architecture,Version,Source Directory"
57+
Add-Content -Path $("$Path\$MakeAlias\$ModelAlias.csv") -Value "$MakeAlias,$ModelAlias,$BaseBoard,$Platform,$WindowsVersion,$Architecture,$Version,$SourceDirectory"
58+
}
59+
60+
Export-TSxWindowsDriver -Path \\SCCM\Drivers$\W101709 -Platform ConfigMgr -WindowsVersion "Windows 10" -Version '1.0' -Architecture x64
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<#
2+
# This script will get driver packages using the Modern Driver Managment WebServices on the machine you run it on
3+
# (http://www.scconfigmgr.com/modern-driver-management)
4+
#>
5+
6+
$Make = (Get-WmiObject -Class Win32_Computersystem).Manufacturer
7+
switch ($Make)
8+
{
9+
'HP'{
10+
$MakeAlias='Hewlett-Packard'
11+
$ModelAlias = (Get-WmiObject -Class Win32_ComputerSystem).model
12+
$BaseBoard = (Get-CIMInstance -ClassName MS_SystemInformation -NameSpace root\WMI).BaseBoardProduct
13+
}
14+
15+
'Hewlett-Packard'{
16+
$MakeAlias=$Make
17+
$ModelAlias = (Get-WmiObject -Class Win32_ComputerSystem).model
18+
$BaseBoard = (Get-CIMInstance -ClassName MS_SystemInformation -NameSpace root\WMI).BaseBoardProduct
19+
}
20+
21+
'Dell'{
22+
$MakeAlias=$Make
23+
$ModelAlias = (Get-WmiObject -Class Win32_ComputerSystem).model
24+
$BaseBoard = (Get-CIMInstance -ClassName MS_SystemInformation -NameSpace root\WMI).SystemSku
25+
}
26+
27+
'LENOVO'{
28+
$MakeAlias=$Make
29+
$ModelAlias = (Get-WmiObject -Class Win32_ComputerSystemProduct).version
30+
$BaseBoard = ((Get-WmiObject -Class Win32_ComputerSystem | Select-Object -ExpandProperty Model).SubString(0, 4)).Trim()
31+
}
32+
33+
'Microsoft Corporation'{
34+
$MakeAlias='Microsoft'
35+
$ModelAlias = (Get-WmiObject -Class Win32_ComputerSystem).model
36+
$BaseBoard = (Get-WmiObject -Class Win32_ComputerSystem).model
37+
}
38+
Default {}
39+
}
40+
41+
$MakeAlias
42+
$ModelAlias
43+
$BaseBoard
44+
45+
$SecrectKey = "329b3c28-1b52-4cd7-abe1-81d93d1e1dda"
46+
$URI = "http://cm01.corp.viamonstra.com/ConfigMgrWebService/ConfigMgr.asmx"
47+
$Web = New-WebServiceProxy -Uri $URI
48+
$Web.
49+
$result = $Web.GetCMPackage($SecrectKey,'Driver')
50+
$result | Where-Object PackageDescription -Like *$BaseBoard*

0 commit comments

Comments
 (0)