none
Get driver versions for multiple core servers remotely RRS feed

  • Question

  • Hello,

    We run Windows 2016 core for most of our environment. When the servers are installed initially I connect to each server via console and use the following commands to install network and storage adapter drivers from an ISO that I mount:

    pnputil -i -a d:\network\*.inf
    pnputil -i -a d:\storage\*.inf

    As new versions of the drivers have been released we have used the new ISO when deploying new servers which has resulted in different driver levels in our environment. I am able to find driver levels by using the following PS command:

    Get-WmiObject Win32_PnPSignedDriver -filter "Devicename like '%Cisco%'" | select DeviceName, Manufacturer, DriverVersion

    I would like to run this command remotely based off of a list of hostnames in order to return a list of all the driver versions in our environment. Is there any easy way to do this?

    Thanks.

    Thursday, July 9, 2020 1:28 PM

Answers

  • Assuming your query is working on a single machine, it should work like this:

    $servers = Get-Content <file-with-names-in-it>
    Get-WmiObject Win32_PnPSignedDriver -ComputerName $servers -filter "Devicename like '%Cisco%'" | 
        Select-Object DeviceName, Manufacturer, DriverVersion

    The file should consist of one server name per line, without leading/trailing spaces or punctuation.


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    • Marked as answer by dbutch1976 Thursday, July 9, 2020 7:34 PM
    Thursday, July 9, 2020 2:44 PM

All replies

  • Assuming your query is working on a single machine, it should work like this:

    $servers = Get-Content <file-with-names-in-it>
    Get-WmiObject Win32_PnPSignedDriver -ComputerName $servers -filter "Devicename like '%Cisco%'" | 
        Select-Object DeviceName, Manufacturer, DriverVersion

    The file should consist of one server name per line, without leading/trailing spaces or punctuation.


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    • Marked as answer by dbutch1976 Thursday, July 9, 2020 7:34 PM
    Thursday, July 9, 2020 2:44 PM
  • This works however it does not specify the names of the host returning the information, I added one field to show the host:

    $servers = Get-Content c:\psscripts\nodes.csv
    Get-WmiObject Win32_PnPSignedDriver -ComputerName $servers -filter "Devicename like '%Cisco%'" | 
        Select-Object PSComputerName,DeviceName, Manufacturer, DriverVersion 

    Unfortunately it's adding multiple duplicates, is there a way to remove them so that I only see one result for each device? Example below:

    PSComputerName DeviceName Manufacturer DriverVersion
    SERVER001 Cisco VIC-FCoE Storport Miniport Cisco Systems, Inc. 3.0.17.6
    SERVER001 Cisco VIC-FCoE Storport Miniport Cisco Systems, Inc. 3.0.17.6
    SERVER001 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER001 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER001 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER001 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER002 Cisco VIC-FCoE Storport Miniport Cisco Systems, Inc. 3.0.17.6
    SERVER002 Cisco VIC-FCoE Storport Miniport Cisco Systems, Inc. 3.0.17.6
    SERVER002 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER002 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER002 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER002 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER003 Cisco VIC-FCoE Storport Miniport Cisco Systems, Inc. 3.0.17.6
    SERVER003 Cisco VIC-FCoE Storport Miniport Cisco Systems, Inc. 3.0.17.6
    SERVER003 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER003 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER003 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER003 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER004 Cisco VIC-FCoE Storport Miniport Cisco Systems, Inc. 3.0.17.6
    SERVER004 Cisco VIC-FCoE Storport Miniport Cisco Systems, Inc. 3.0.17.6
    SERVER004 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER004 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER004 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER004 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER005 Cisco VIC-FCoE Storport Miniport Cisco Systems, Inc. 3.0.17.6
    SERVER005 Cisco VIC-FCoE Storport Miniport Cisco Systems, Inc. 3.0.17.6
    SERVER005 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER005 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER005 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3
    SERVER005 Cisco VIC Ethernet Interface Cisco Systems, Inc. 4.0.0.3

     

    • Edited by dbutch1976 Thursday, July 9, 2020 6:08 PM
    Thursday, July 9, 2020 5:21 PM
  • Your original example didn't show the name of the computer either. :-)

    To get only unique items, you can either use Sort-Object with the "-Unique" switch, or you can pipe the results of the sort into the Get-Unique cmdlet. E.g. Sort-Object | Get-Unique.

    Assuming you'll want a unique item per machine you have to use multiple properties, so be sure to sort on the appropriate property names. Which properties I don't know. You select four but only show two columns in your example.


    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    Thursday, July 9, 2020 7:40 PM
  • Thanks Rich,

    Ideally I would like to see only two items per server, one for each device, for example:

    "PSComputerName","DeviceName","Manufacturer","DriverVersion"
    "SERVER001","Cisco VIC-FCoE Storport Miniport","Cisco Systems, Inc.","3.0.17.6"
    "SERVER001","Cisco VIC-FCoE Storport Miniport","Cisco Systems, Inc.","3.0.17.6"
    "SERVER001","Cisco VIC Ethernet Interface","Cisco Systems, Inc.","4.0.0.3"
    "SERVER001","Cisco VIC Ethernet Interface","Cisco Systems, Inc.","4.0.0.3"
    "SERVER001","Cisco VIC Ethernet Interface","Cisco Systems, Inc.","4.0.0.3"
    "SERVER001","Cisco VIC Ethernet Interface","Cisco Systems, Inc.","4.0.0.3"
    "SERVER002","Cisco VIC-FCoE Storport Miniport","Cisco Systems, Inc.","3.0.17.6"
    "SERVER002","Cisco VIC-FCoE Storport Miniport","Cisco Systems, Inc.","3.0.17.6"
    "SERVER002","Cisco VIC Ethernet Interface","Cisco Systems, Inc.","4.0.0.3"
    "SERVER002","Cisco VIC Ethernet Interface","Cisco Systems, Inc.","4.0.0.3"
    "SERVER002","Cisco VIC Ethernet Interface","Cisco Systems, Inc.","4.0.0.3"
    "SERVER002","Cisco VIC Ethernet Interface","Cisco Systems, Inc.","4.0.0.3"

    Should be:

    "PSComputerName","DeviceName","Manufacturer","DriverVersion"
    "SERVER001","Cisco VIC-FCoE Storport Miniport","Cisco Systems, Inc.","3.0.17.6"
    "SERVER001","Cisco VIC Ethernet Interface","Cisco Systems, Inc.","4.0.0.3"
    "SERVER002","Cisco VIC-FCoE Storport Miniport","Cisco Systems, Inc.","3.0.17.6"
    "SERVER002","Cisco VIC Ethernet Interface","Cisco Systems, Inc.","4.0.0.3"


    Thursday, July 9, 2020 7:56 PM
  • Sort-Object -Property pscomputername,devicename,DriverVersion -unique

    --- Rich Matheisen MCSE&I, Exchange Ex-MVP (16 years)

    Thursday, July 9, 2020 9:15 PM
  • Hi Rich,

    Thanks for all your help, the final version is working perfectly, thanks!

    $servers = Get-Content c:\psscripts\nodes.csv
    Get-WmiObject Win32_PnPSignedDriver -ComputerName $servers -filter "Devicename like '%Cisco%'" | Select-Object PSComputerName,DeviceName, Manufacturer, DriverVersion | Sort-Object -Property pscomputername,devicename,DriverVersion -unique | Export-Csv -Path C:\PSscripts\output.csv -NoTypeInformation

    Friday, July 10, 2020 1:13 PM