widsnet.com
11Jul/120

List all drivers used in a Boot Image

How do you know which drivers are used in a boot image?
This powershell script will tell...

$Bootimage = 'C010117C'
$SCCMServer = 'Server1'
$SCCMNameSpace = 'root\sms\site_C01'

Get-WmiObject -Query "SELECT PackageID, Name, PkgSourcePath FROM SMS_BootImagePackage WHERE PackageID='$BootImage'" -ComputerName $SCCMServer -Namespace $SCCMNameSpace |
ForEach-Object {
    Write-Host "Boot Image ID: $($_.PackageID)"
    Write-Host "`tName: $($_.Name)"
    Write-Host "`tPath: $($_.PkgSourcePath)`n"
}
$i = 0
Get-WmiObject -Query "SELECT CI_ID FROM SMS_BootImagePackage_DriverRef WHERE PkgID='$BootImage'" -ComputerName $SCCMServer -Namespace $SCCMNameSpace | 
ForEach-Object {
    Get-WmiObject -Query "SELECT * FROM SMS_Driver WHERE CI_ID='$($_.CI_ID)'" -ComputerName $SCCMServer -Namespace $SCCMNameSpace | 
    ForEach-Object {
        $i++
        Write-Host "$i Driver Name: $($_.LocalizedDisplayName)"
        Write-Host "`tVersion: $($_.DriverVersion)"
        Write-Host "`tClass: $($_.DriverClass)"
        Write-Host "`tCategory: $($_.LocalizedCategoryInstanceNames -Join '; ')"
        Write-Host "`tPath: $($_.ContentSourcePath)"
    }
}


Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

No trackbacks yet.