|
PowerShell one liner to get USB Flash Drive Serial Number |
Si vous voulez bloquer ce service sur vos fils RSS
Si vous voulez nous contacter ou nous proposer un fil RSS
Menu > Articles de la revue de presse : - l'ensemble [ tous | francophone] - par mots clé [ tous] - par site [ tous] - le tagwall [ voir] - Top bi-hebdo de la revue de presse [ Voir]
PowerShell one liner to get USB Flash Drive Serial Number Par grand stream dreamsLe [2016-02-14] à 01:37:43
Présentation : First a confession, I bought the Learn Windows PowerShell 3 in a Month of Lunches book quite a while ago but still haven t had the discipline to work my way through it. Couple that with tons of PowerShell learning resources documented across the GSD blog and I am woefully behind the game. However, I can read music so I guess that means I can puzzle out code with patience and Google searching. One of my duties is to keep inventory of USB device issuances to the team. I record the serial numbers of the devices in a spreadsheet. While some external USB HDD s have the device serial number listed on the external case, USB flash drives aren t so good wtih that practice. There are some USB imaging tools such as the USB Image Tool or utilities such as USBDeview or Kanguru s free Serial Number Display Tool that I could use to get that information directly. However, I really like to stick with in-box tools and techniques so while that would be the easy way I ve been collecting the information the long-way-round by the following process 1. Insert USB flash drive into system. 2. Open Control Panel 3. Open Device Manager 4. Expand the Universal Serial Bus controllers item 5. Look for the USB Mass Storage Device in the list that s my inserted flash drive 6. Right-click that item and select Properties 7. Select the Details tab 8. In the Properties list, pick Device Instance Path 9. Read the serial number which is the trailing string after the last Eject and repeat. What I wanted to do was just run a WMIC query directly from the command line to get that specific information via the Command Prompt. But despite my best efforts which isn t saying much I wasn t able to locate the correct parameter. Tonight I did find and tweak a similar command via PowerShell and it does the trick. So while it isn t elegant, it does the job I need. Victory at last gwmi Win32_USBControllerDevice pourcents wmi .Dependent Where-Object .Description -like ' mass ' Sort Description,DeviceID ft Description,DeviceID auto That s one long string btw. So I can get a result like this Description DeviceID ----------- -------- USB Mass Storage Device USB VID_0DD8 PID_3200 Your DeviceID details will vary depending on the make model etc. but the serial number is there easy to copy paste. Credits wmi - Getting a USB Device Instance Path in Powershell - Stack Overflow. This post got me finally on the right track but still didn t work for me. Displaying USB Devices using WMI - Windows PowerShell Blog. Jeffrey Snover s post did get me the output I was looking for, but I then needed to clean it up just a bit as I only wanted the USB Mass Storage Device information. Filtering PowerShell Objects - PowerShell content from Windows IT Pro. This was the final bit in giving examples how I could filter for just the one line I needed. If anyone can refine the code or filter it more to just pass on the Serial Number string itself, I would be grateful for any recommendations. Using PowerShell s gwmi or the Command WMIC call are powerful ways to get system information. Here are some additional examples that I ve collected trying to puzzle out my own particular USB Mass Storage device query technique that could be helpful to sysadmins Using wmic to obtain model and serial numbers for Dell systems - MoonPoint Support Weblog WMIC share get - MoonPoint Support Weblog WMIC startup - MoonPoint Support Weblog Get Wireless Network SSID and Password with PowerShell - Hey, Scripting Guy Blog Windows Quick Tip Who is Accessing Network Resources - Next of Windows Using wmic to get disk drive information - MoonPoint Support Weblog Obtaining the model number and serial number for a HDD from the command line - MoonPoint Support Weblog Retrieving Hard Drive Serial Number via WMIC Spiceworks How to Retrieve the REAL Hard Drive Serial Number - CodeProject Win32_PhysicalMedia PowertheShell.com Win32_DiskDrive class Windows Microsoft Developer Network WMI Disk serial number TechNet Script Center Cheers --Claus Valca. Bonus USB utility finds USB Enumerator Utility Kanguru Tech Support USB View Kanguru Tech Support USB Detect Launch Endpoint 101
Les mots clés de la revue de presse pour cet article : powershell flash Les videos sur SecuObs pour les mots clés : powershell flash serial Les éléments de la revue Twitter pour les mots clé : flash
Les derniers articles du site "grand stream dreams" :
- Browser MetaData Leakage - MXA Another specialized Windows Performance Tracing tool - Opening more than one Firefox bookmarks Library - Win 7 Task Image Corruption Errors In which A Quick Fix is found and Blame is to be Assigned - Fixing Glasswire Upgrade Issue failed to attach to service - Open Live Writer There are Nightlies - PowerShell one liner to get USB Flash Drive Serial Number - Only my own procrastination to blame - Universal Extractor and updated builds - Windows Update Agent Utility WUAUclt.exe
Menu > Articles de la revue de presse : - l'ensemble [ tous | francophone] - par mots clé [ tous] - par site [ tous] - le tagwall [ voir] - Top bi-hebdo de la revue de presse [ Voir]
Si vous voulez bloquer ce service sur vos fils RSS :
- avec iptables "iptables -A INPUT -s 88.190.17.190 --dport 80 -j DROP"
- avec ipfw et wipfw "ipfw add deny from 88.190.17.190 to any 80"
- Nous contacter par mail
Mini-Tagwall des articles publiés sur SecuObs : | | | | sécurité, exploit, windows, attaque, outil, microsoft, réseau, audit, metasploit, vulnérabilité, système, virus, internet, usbsploit, données, source, linux, protocol, présentation, scanne, réseaux, scanner, bluetooth, conférence, reverse, shell, meterpreter, vista, rootkit, détection, mobile, security, malicieux, engineering, téléphone, paquet, trames, https, noyau, utilisant, intel, wishmaster, google, sysun, libre |
Mini-Tagwall de l'annuaire video : | | | | curit, security, biomet, metasploit, biometric, cking, password, windows, botnet, defcon, tutorial, crypt, xploit, exploit, lockpicking, linux, attack, wireshark, vmware, rootkit, conference, network, shmoocon, backtrack, virus, conficker, elcom, etter, elcomsoft, server, meterpreter, openvpn, ettercap, openbs, iphone, shell, openbsd, iptables, securitytube, deepsec, source, office, systm, openssh, radio |
Mini-Tagwall des articles de la revue de presse : | | | | security, microsoft, windows, hacker, attack, network, vulnerability, google, exploit, malware, internet, remote, iphone, server, inject, patch, apple, twitter, mobile, virus, ebook, facebook, vulnérabilité, crypt, source, linux, password, intel, research, virtual, phish, access, tutorial, trojan, social, privacy, firefox, adobe, overflow, office, cisco, conficker, botnet, pirate, sécurité |
Mini-Tagwall des Tweets de la revue Twitter : | | | | security, linux, botnet, attack, metasploit, cisco, defcon, phish, exploit, google, inject, server, firewall, network, twitter, vmware, windows, microsoft, compliance, vulnerability, python, engineering, source, kernel, crypt, social, overflow, nessus, crack, hacker, virus, iphone, patch, virtual, javascript, malware, conficker, pentest, research, email, password, adobe, apache, proxy, backtrack |
|
|
|
|
|