locked
Monitoring disconnected status of PS/2 Keyboard and Desktop Monitor RRS feed

  • Question

  • I tried to create WMI Script using Win32_Keyboard & Win32_DesktopMonitor class to find whether the device is connected or not. It works when the device is connected. However it does not detect when the device is disconnected. Device Manager continue to show the device until the desktop is rebooted. I tried with several other Win32 class but it did not work. Is there a way to find the disconnected state of this device.
    Friday, October 31, 2014 8:23 PM

Answers

  • Hi,

    I would like to suggest you run below powershell command to check keyboard and monitor status:

     Get-WmiObject -ClassName win32_keyboard | select deviceid, status

     Get-WmiObject -ClassName win32_desktopmonitor | select deviceid, status

    Regards,

    Yan Li


    Regards, Yan Li

    • Proposed as answer by Adin ErmieMVP Tuesday, November 4, 2014 2:40 PM
    • Marked as answer by Yan Li_ Monday, November 10, 2014 2:33 AM
    Monday, November 3, 2014 2:14 AM

All replies

  • Hi,

    I would like to suggest you run below powershell command to check keyboard and monitor status:

     Get-WmiObject -ClassName win32_keyboard | select deviceid, status

     Get-WmiObject -ClassName win32_desktopmonitor | select deviceid, status

    Regards,

    Yan Li


    Regards, Yan Li

    • Proposed as answer by Adin ErmieMVP Tuesday, November 4, 2014 2:40 PM
    • Marked as answer by Yan Li_ Monday, November 10, 2014 2:33 AM
    Monday, November 3, 2014 2:14 AM
  • It worked for desktop monitor. However, there is no change to PS2 keyboard while it worked for USB Keyboard. The result is the same whether PS2 keyboard is connected or disconnected
    Wednesday, November 12, 2014 1:14 PM