Pages

Showing posts with label query. Show all posts
Showing posts with label query. Show all posts

Tuesday, July 5, 2011

WMI Script to get details about local Computer System

Below script will give you details about local computer system using WMI.

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
    "SELECT * FROM Win32_ComputerSystem",,48)

For Each objItem in colItems
    Wscript.Echo "Win32_ComputerSystem instance"
    Wscript.Echo "Caption: " & objItem.Caption
    Wscript.Echo "Description: " & objItem.Description
    Wscript.Echo "Domain: " & objItem.Domain
    Wscript.Echo "Manufacturer: " & objItem.Manufacturer
    Wscript.Echo "Model: " & objItem.Model
Next