i need some help
any help in this
i want to get the history of devices logged in the pc
only i need the date it logged in and the serial number
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
VulpesRank #55 · 29.2K reputationPosted Mar 20, 2013, 3:51 AM EDT
You'd think that, if you're using Vista or later, it would be a simple matter of querying the WMI class, Win32_DiskDrive, to get this information:
http://msdn.microsoft.com/en-gb/library/windows/desktop/aa394132(v=vs.85).aspx
However, for the devices I tried, the SerialNumber property gave silly answers and the InstallDate property didn't work at all!
I did eventually figure out that you could parse out the serial number from the PNPDeviceID property and the following code shows how to do that:
As far as the log in date is concerned, I couldn't find any way to get at this statically but there's a Code Project article here which shows how to detect in real time when devices are plugged-in and removed which may be of some help to you:
http://www.codeproject.com/Articles/63878/Enumerate-and-Auto-Detect-USB-Drives#AWalkAroundWMI