次の方法で共有


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 : 6373933056

 Cool.  (Even moreso because I might get them to let me have a G5.)

Comments

  • Anonymous
    March 26, 2012
    Here's a function for it: function Get-ComputerSKU {    param ( [string[]]$computerName = @('.') );    $computerName | % {        if ($) {            Get-WmiObject -ComputerName $ Win32_ComputerSystem | Select-Object __Server, Manufacturer, Model;        }    } }