How to disable a device using PowerShell Disable-PnpDevice Cmdlet
In this lesson, let us learn how to disable a device using PowerShell Disable-PnpDevice cmdlet. PowerShell Disable-PnpDevice cmdlet can be used to disable a device, if you are working in a Windows 2025 Server Core computer, where there is no Graphical User Interface.
You must be a Windows Server administrator to run these tasks successfully. Click the following link to learn how to run PowerShell as administrator, and how to run PowerShell as administrator in Server Core.
Step 01 – Run Get-PnpDevice PowerShell cmdlet to find information about the Plug and Play (PnP) devices, as shown below. In this example, I had selected a Gigabit Ethernet Network adapter device. Remaining output are truncated.
PS C:\jajish> Get-PnpDevice | Format-Table -Property FriendlyName,InstanceID FriendlyName InstanceId ------------ ---------- <command output truncated> ***** Gigabit Network Connection PCI\VEN_8086&DEV_10D3&SUBSYS_07D015AD&REV_00\000C29FFFF739D8400 <command output truncated>
From the output of the Get-PnpDevice PowerShell cmdlet, we can find the InstanceId of the devices, as shown in above output.
Step 02 – Now, run the Disable-PnpDevice PowerShell cmdlet, with the InstanceId found from the above Get-PnpDevice cmdlet output to disable the particular Plug and Play (PnP) device, as shown below. Make sure to enclose the InstanceId between single quots.
PS C:\jajish> PS C:\jajish> Disable-PnpDevice -InstanceId ’PCI\VEN_8086&DEV_10D3&SUBSYS_07D015AD&REV_00\000C29FFFF739D8400’ Confirm Are you sure you want to perform this action? Performing the operation "Disable" on target "Win32_PnPEntity: <output omitted> Gigabit Network Connection (DeviceID = "PCI\VEN_8086&DEV_10D3&SUBSYS_07D015AD&R...)". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y PS C:\jajish>
The device is disabled now, using the Disable-PnpDevice PowerShell cmdlet.
Written by Jajish Thomas.
Last updated on 14th July, 2024.