标题: [转载代码] [PowerShell每日技巧]查看USB设备使用历史信息(20140327) [打印本页]
作者: DAIC 时间: 2014-4-4 20:38 标题: [PowerShell每日技巧]查看USB设备使用历史信息(20140327)
Did you know that Windows logs any USB stick type you ever used? To get that information from the Registry, simply use this function:- function Get-USBInfo
- {
- param
- (
- $FriendlyName = '*'
- )
-
- Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\USBSTOR\*\*\' |
- Where-Object { $_.FriendlyName } |
- Where-Object { $_.FriendlyName -like $FriendlyName } |
- Select-Object -Property FriendlyName, Mfg |
- Sort-Object -Property FriendlyName
- }
复制代码
You can query for specific manufacturers, too:- Get-USBInfo -FriendlyName *king*
复制代码
http://powershell.com/cs/blogs/tips/archive/2014/03/27/finding-usb-stick-information.aspx
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |