none
Powershell Script for uninstall driver RRS feed

  • Question

  • Hi Guys,

    I want to write a Powershell-script that deletes/removes a driver on multiple WinServer2008R2 servers.

    I tried it by using "pnputil.exe -e" , to get a list of installed Drivers. In this list I want to use the driver Version as a parameter  to identify the corresponding oem**.inf , to delete this later with "pnputil -d oem**.inf".

    The list looks as follows:

    Published Name:                    oem29.inf

    Driver package Provider:        HP

    Class:                                   Printers

    Driver date and Version:        01/11/2017 61.196.01.22169

    Signer Name:                       Microsoft Windows Hardware Compatibility Publisher

    The problem is, that i don't know how to write a suitable query in Powershell, that has the driver version as a parameter and returns the value of the matching Published Name. The reason for the necessity of the query is that on each Server the oem**.inf I'm looking for, is named differently.

    Can someone help me solve my Problem, or give a Suggestion as it is easier to solve, perhaps another approach ?

    Thank you in advance for your Response :)

    Danny_96

    Friday, September 1, 2017 9:25 AM

Answers

All replies

  • Danny,

    could you please start by reading this: This forum is for scripting questions rather than script requests

    You can try to find somthing what fits to your needs in PowerShell Gallery or in Microsoft Technet Script Center


    Grüße - Best regards

    PS:> (79,108,97,102|%{[char]$_})-join''

    • Marked as answer by Danny_96 Tuesday, September 5, 2017 12:08 PM
    Friday, September 1, 2017 10:24 AM
  • Get-WmiObject Win32_PnPSignedDriver -filter "InfName='oem29.inf'" | select DriverVersion

    It is up to you to learn PowerShell so you can understand how to use this information.


    \_(ツ)_/

    Friday, September 1, 2017 5:34 PM
  • Hallo Olaf,

    Dankeschön für den Verweis auf die Powershell Gallerie :)

    Das Skript PurgeOemInf.ps1 beinhaltete die Lösung für mein Problem.

    Beste Grüße,

    Danny

    Monday, September 4, 2017 7:17 AM
  • Hello,

    I think I have not asked my question correctly.

    I know the Driver Version for the packet I want to uninstall. By this I wanted to determine the according oem-file to uninstall this later. With pnputil -e i can do this manually, but this way isn't convenient when it comes to automate the procedure for multiple Servers.

    Nevertheless, thanks for your help!

    Best regards, Danny

    Monday, September 4, 2017 7:44 AM
  • Danny,

    schön, dass ich helfen konnte. Vielleicht möchtest Du diese Info nochmal auf english posten und diesen dann als Lösung markieren, damit andere, die ein ähnliches Problem haben, die Lösung schneller finden. Gern mit einem Link auf das Script, was Du gefunden hast.

    Wenn Du in Zukunft lieber auf deutsch fragen möchtest ... es gibt auch ein deutsches Powershell-Forum!  ;-)


    Grüße - Best regards

    PS:> (79,108,97,102|%{[char]$_})-join''

    Monday, September 4, 2017 5:35 PM