NOTE!
If you want to browse the WMI information I recommend SimpleWMIView by NirSoft.
If you don't have PS 7 installed, replace "pwsh" with "powershell".
Example
This query asks WMI about some basic info about the physical disk drives in the system:
Get-CimInstance -ClassName Win32_DiskDrive | Select-Object Model,SerialNumber,FirmwareRevision,Status
You can run this in a PowerShell window as is, but to run it as favourite we have to add some stuff:
pwsh -NoExit -Command "Get-CimInstance -ClassName Win32_DiskDrive | Select-Object Model,SerialNumber,FirmwareRevision,Status"
Favourite
UserVar:
{pwshopt}=-NoExit -Command "Get-CimInstance -ClassName
Type: Application
Basic Settings, Application: pwsh
Adv. Settings, Parameters: -NoExit -Command "Get-CimInstance -ClassName Win32_DiskDrive | Select-Object Model,SerialNumber,FirmwareRevision,Status"
Or, we can clean up a little with a UserVar:
Basic Settings, Application: pwsh
Adv. Settings, Parameters: {pwshopt} Win32_DiskDrive | Select-Object Model,SerialNumber,FirmwareRevision,Status"
(Don't forget the qoutation mark at the end)
Other WMI classes that might be interesting
Win32_PhysicalMemory | Select-Object BankLabel,Capacity,ConfiguredClockSpeed,DeviceLocator,Manufacturer,PartNumber,SerialNumber,Speed
Win32_LogicalDisk | Select-Object DeviceID, FileSystem, ProviderName, VolumeName,VolumeSerialNumber
Win32_NetworkAdapter | Select-Object DeviceID, Name, MACAddress
Win32_NetworkAdapterConfiguration | Select-Object Index, Description, MACAddress, IPAddress, DefaultIPGateway
(Use Select-Object * to show all objects in that class)
Win32_BaseBoard | Select-Object *
Win32_BIOS | Select-Object *
Win32_ComputerSystem | Select-Object *
Win32_Service | Select-Object *
Win32_Processor | Select-Object *
In the last part (part 3) we'll look at very simple script to do some more stuff.
Now, go forth and play with WMI!
Regards,
joeNOR
(EDIT: Fixed error with Select-Object)