My drop-site for interesting snippets and tips. If it's useful to you as well, great!
Translate This Page
Translate this page
PowerShell for N00bs
PowerShell for Non-N00bs
Browse by Tags
Tagged Content List
WMI and HP Product IDs
An HP Product ID is related to the hardware SKU The plain-English way of getting the SKU is Get-WMIObject –ComputerName $computerName Win32_ComputerSystem However, our inventory system uses the HP product ID property stuffed in ILO. As someone who uses the test lab, this isn’t something that I...
28 Feb 2014
WMI-Less Network Adapters
We can get a list of network adapters (calling them NICs is a bit outdated: the C in NIC stands for ‘card’, like it’s something you plug into an ISA or PCI slot. These days, it’s almost always built in) from Get-WMI Win32_NetworkAdapter and Win32_NetworkAdapterConfiguration, but per http://msdn...
26 Feb 2014
Getting User Names for Processes
Sometimes, I am in awe at the PowerShell team. Other times, I am stunned, but at their inability to grasp common user scenarios. PSH3, for example, finally allows Get-ChildItem to specify “files only” or “directories only” (but their way of specifying attributes is a whole other syntax, which...
8 Aug 2013
PowerShell One-Liner: Getting This Computer's Asset Tag Number
Here's a gem from an internal email: CMD> wmic SystemEnclosure get SMBIOSAssetTag 5551212 If the system has asset tag data added to the BIOS, this is a way to collect it.
28 Oct 2009
PowerShell for Non-N00bs: Formatting Time With RegEx
So, last episode we learned how to format the output of a LastBootUpTime property from the WIN32_OperatingSystem WMI query to something human readable using WMI. What if that didn't exist? PSH> (Get-WmiObject -Query 'SELECT LastBootUpTime FROM Win32_OperatingSystem').LastBootUpTime 20090712112652...
26 Oct 2009
PowerShell for Non-N00bs: System Uptime Via WMI
Getting the last time a system was rebooting is pretty easy from WMI. From this half-decade old post , we get the two key bits: the LastBootUptTimem property of the Win32_OperatingSystem WMI class. In PowerShell, it looks like this: PSH> (Get-WmiObject -Query 'SELECT LastBootUpTime FROM Win32_OperatingSystem...
24 Oct 2009
One-Liner: Getting This Computer's Serial Number
The computer's serial number can be very useful. Among other things, many manufactuers' support sites keep record of their machine's serial numbers to serve the right drivers for downloads. CMD> wmic bios get serialnumber SerialNumber ABCDEF12345 Wmic is the command line executable for performing...
19 Oct 2009
PowerShell One-Liner: Hardware SKU
Someone asked me what kind of server I was running in the lab. Uh, I don't have lab access, and even if I do, how the heck would I find it? PS> Get-WmiObject Win32_ComputerSystem | fl Domain : testlab Manufacturer : HP Model : ProLiant DL380 G4 Name : testlab1234 PrimaryOwnerName : TotalPhysicalMemory...
22 Sep 2009
Page 1 of 1 (8 items)
© 2014 Microsoft Corporation.
Privacy & Cookies