In this article, we will see how to get windows device driver details using PowerShell. Finding driver information is necessary as information gathering prior to software or system upgrades.

WMI class Win32_PnPSignedDriver is used to get the device driver information

#Fetch all properties
Get-CimObject Win32_PnPSignedDriver | fl *
Get-CimInstance Win32_PnPSignedDriver | `
    Select DeviceClass, DeviceID, DeviceName, InfName, DriverVersion, FriendlyName, IsSigned

This would enumerate complete information in the local system.

To get information from multiple systems, the command has to be executed against the respective servers. The server names can be either fetched from active directory or from text file.

The code below will query for IBM SDDDSM driver information from a list of servers in a text file.

$servers = Get-Content "D:\server.txt"

foreach($server in $servers)
{
  
    Get-CimInstance Win32_PnPSignedDriver -ComputerName $server -ErrorAction SilentlyContinue | `
        where {$_.devicename -like "*IBM SDDDSM*"} | `
        select PSComputerName, DeviceClass, DeviceID, DeviceName, InfName, DriverVersion, FriendlyName, IsSigned
    if($Error)
    {
        #Display error if any server fails
        $server + " Error"
        $Error.Clear()
    }
}

Hope this is helpful and thank you for reading.