Quick Steps for Disabling/Enabling Hardware Devices Using Powershell`` (Run in **Administartor mode !)
In this example, I will be disabling the Killer Networks E2400 Network Controller.
Step 1: Confirm the device is present and enabled
Get-PnpDevice -FriendlyName "*ftdi*" // HERE YOU HAVE TO USE A PART OF THE NAME AS SEEN IN DEVICE_MANAGER
A status of OK indicates the device is enabled. The class, friendly name, and truncated InstanceId is also displayed.
Confirm the device is present and enabled using get-pnpdeviceConfirm the device is present and enabled using get-pnpdevice
Step 2: Find the InstanceID of the device
Get-PnpDevice -FriendlyName "*ftdi*" | ft -wrap -autosize friendlyname, instanceid
This command returns the friendlyname and instanceid without truncating the values.
Use get-pnpdevice to find the instanceidUse get-pnpdevice to find the instanceid
Step 3: Disable the device using the InstanceID found in step 2
Disable-PnpDevice -InstanceId "PCI\VEN_XXXX&DEV_XXXX&SUBSYS_E000XXXX&REV_10\4&325XXXX&0&00XX -confirm:$false
Copy the full InstanceId found in step 1 into the disable cmdlet.
use disable-pnp to disable the device using powershelluse disable-pnp to disable the device using powershell
Step 4: Check your work using Get-PnpDevice
Get-PnpDevice -FriendlyName "*ftdi*"
A status of ‘Error’ indicates that the device is not enabled. You can also check manually with the device manager.
get-pnpdevice shows the device is disabledget-pnpdevice shows the device is disabled
You can now re-enable the device by using enable-pnpdevice -instanceid as follows:
Enable-PnpDevice -InstanceId "PCI\VEN_XXXX&DEV_XXXX&SUBSYS_E000XXXX&REV_10\4&325XXXX&0&00XX" -confirm:$false
You can then confirm it is enabled by using get-pnpdevice one more time. A status of ‘OK’ indicates that it is enabled.
Get-PnpDevice -FriendlyName "*ftdi*"
If that works pack into a script and you are good to go