Hello,
I'm looking for a way to manage drives remotely for the techs
Essentially query the PC, list the drivers, give them easy selections USB, DisplayDrivers, Mouse, etc... remotely remove
Think Device Uninstall in device management but not remove the software
I can't seem the find the best solution that provides me with the cleanest details
for example
when I do
Get-CimInstance win32_PnPSignedDriver | Select-Object Description,DeviceClass,DriverProviderName,DriverVersion,FriendlyName,InfName,Manufacturer | Where-Object {$_.Description -ne $null}
But how do I take the InfName, and perform the Device Uninstall?
Displaying and Interacting with Drivers
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
- apowershelluser
- Posts: 194
- Last visit: Mon Apr 15, 2024 3:21 pm
Re: Displaying and Interacting with Drivers
You can only display installed drivers. There is a folder under windows that contains inf files for drivers that are available for installation. You would have to learn how to read these files. They contain manufacturer model and options for a driver along with the driver binaries list.
The folder is here: C:\Windows\INF
The folder is here: C:\Windows\INF
Re: Displaying and Interacting with Drivers
Here is what a driver INF looks like. This is the USB print driver file.
- [Version]
- Signature="$WINDOWS NT$"
- Class=USB
- ClassGUID={36FC9E60-C465-11CF-8056-444553540000}
- Provider=%MSFT%
- DriverVer = 06/21/2006,10.0.17763.1
- [SourceDisksNames]
- 3426=windows cd
- [SourceDisksFiles]
- usbprint.sys = 3426
- [ControlFlags]
- ExcludeFromSelect = *
- [DestinationDirs]
- DefaultDestDir = 12
- ; don't need this yet. USBPRINT_Inst.CopyFilesDLL.NT = 11
- [Manufacturer]
- %MSFT%=Microsoft,NTamd64
- [Microsoft.NTamd64]
- %USBPRINT.DeviceDesc% = USBPRINT_Inst,USB\Class_07,GENERIC_USB_PRINTER
- %USBPRINT_UNKNOWNPRINTER.DeviceDesc% = NO_DRV, USBPRINT\UnknownPrinter
- ;=====================================================================
- [USBPRINT_Inst.NT]
- Copyfiles = USBPRINT_Inst.CopyFiles.NT, USBPRINT_Inst.CopyFilesDLL.NT
- [USBPRINT_Inst.CopyFiles.NT]
- usbprint.sys,,,0x100
- [USBPRINT_INST.CopyFilesDLL.NT]
- [USBPRINT_Inst.NT.Services]
- AddService = usbprint,0x00000002,USBPRINT_Service_Inst
- ;=====================================================================
- [USBPRINT_Service_Inst]
- DisplayName = %USBPRINT.SvcDesc%
- ServiceType = 1 ;KERNEL_DRIVER
- StartType = 3 ;DEMAND START
- ErrorControl = 1 ;RROR_NORMAL
- ServiceBinary = %12%\usbprint.sys
- LoadOrderGroup = extended base
- ;SPSVCINST_TAGTOFRONT = 0x00000001
- ;SPSVCINST_ASSOCSERVICE= 0x00000002
- ;SERVICE_KERNEL_DRIVER = 1
- ;SERVICE_BOOT_START = 0
- ;SERVICE_SYSTEM_START = 1
- ;SERVICE_AUTO_START = 2
- ;SERVICE_DEMAND_START = 3
- ;SERVICE_ERROR_NORMAL = 1
- ;SERVICE_ERROR_IGNORE = 0
- [NO_DRV.NT]
- [NO_DRV.NT.Services]
- AddService = , 2 ; null service install
- [Strings]
- ;Non-Localizable
- MSFT = "Microsoft"
- ;Localizable
- USBPRINT.DeviceDesc = "USB Printing Support"
- USBPRINT_UNKNOWNPRINTER.DeviceDesc = "No Printer Attached"
- USBPRINT.SvcDesc = "Microsoft USB PRINTER Class"
Re: Displaying and Interacting with Drivers
You cannot easily mange devices remotely. The closest you can come is with the PNP WMI classes.
Win32_PnPDevice
Win32_PnPEntity
Win32_PnPSignedDriver
Win32_PnPDeviceProperty
Also:
Get-WmiObject -list WIn32_PnP*
Win32_PnPDevice
Win32_PnPEntity
Win32_PnPSignedDriver
Win32_PnPDeviceProperty
Also:
Get-WmiObject -list WIn32_PnP*
Re: Displaying and Interacting with Drivers
Also review the following:
Get-WmiObject -list Win32_Systemd*
Note that these classes only work with installed drivers and devices. THey cannot discover uninstalled drivers and devices like we see in DeviceManager. The DM APIs can be found in the Windows Hardware Dev Center .
Get-WmiObject -list Win32_Systemd*
Note that these classes only work with installed drivers and devices. THey cannot discover uninstalled drivers and devices like we see in DeviceManager. The DM APIs can be found in the Windows Hardware Dev Center .
Re: Displaying and Interacting with Drivers
Here is one thing I just thought of. FOr PnP devices that have been plugged in and have not automatically been installed we can find them like this:
The error codes are here: https://support.microsoft.com/en-us/hel ... in-windows
Code: Select all
Get-WmiObject Win32_PNPEntity |
Where-Object{$_.ConfigManagerErrorCode -ne 0} |
Select Name, DeviceID, ConfigManagerErrorCode
- apowershelluser
- Posts: 194
- Last visit: Mon Apr 15, 2024 3:21 pm
Re: Displaying and Interacting with Drivers
The way we do it in our environment say we want to remove the display driver
Go to device management
Find the display adapter
Right click and choose uninstall
We make sure that “delete associated software” is uncheck
And reboot the machine
Upon logging in, Windows finds the device and installs it.
That’s what I’m looking to do.
Go to device management
Find the display adapter
Right click and choose uninstall
We make sure that “delete associated software” is uncheck
And reboot the machine
Upon logging in, Windows finds the device and installs it.
That’s what I’m looking to do.
- apowershelluser
- Posts: 194
- Last visit: Mon Apr 15, 2024 3:21 pm
- apowershelluser
- Posts: 194
- Last visit: Mon Apr 15, 2024 3:21 pm
Re: Displaying and Interacting with Drivers
After some more time researching I’ve discovered MS isn’t letting us do this without devcon