A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Waterfall_Cache has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 47

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 194

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Memcache_Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 275

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; Filesystem_Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 440

A PHP Error was encountered

Severity: 8192

Message: Methods with the same name as their class will not be constructors in a future version of PHP; APC_Cache_System has a deprecated constructor

Filename: _common/waterfall_cache.php

Line Number: 628

Discover System Properties Using WMI

Discover System Properties Using WMI

By ServerWatch Staff (Send Email)
Posted Aug 23, 2000


Download the authoritative guide: Data Center Guide: Optimizing Your Data Center Strategy

Download the authoritative guide: Cloud Computing: Using the Cloud for Competitive Advantage

by John Loomes

This script uses WMI to walk through the 'Win32_OperatingSystem' object. This allows you to remotely discover such information as Last Boot Time, NetBIOS Name, Service Pack Level, share names etc... This script uses WMI to walk through the 'Win32_OperatingSystem' object. This allows you to remotely discover such information as Last Boot Time, NetBIOS Name, Service Pack Level, share names etc...

This script is only an example that works on a single host, but it could be easily modified to walk through a list of hosts, or the result of a query etc etc......

Set SystemSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//MY_PC").InstancesOf ("Win32_OperatingSystem")

for each System in SystemSet
    WScript.Echo "NETBIOS Name: "& System.CSName
    'WScript.Echo "System.BuildType
    WScript.Echo "Service Pack: " & System.CSDVersion
    WScript.Echo "Last Booted: " & System.LastBootUpTime
    WScript.Echo "Manufacturer: " & System.Manufacturer
    WScript.Echo "O/S Version: " & System.Version
    WScript.Echo System.Name
    iEqual = InStr(1,System.Name, "Workstation",1)
    If (iEqual <> 0) Then
    MsgBox ("Workstation")
    Else
    MsgBox ("Not a Workstation")
    End if
next

Set SystemSet = Nothing

Set ComputerSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//MY_PC").InstancesOf ("Win32_Share")

for each Object in ComputerSet
    WScript.Echo "Share: "& Object.Name
next

Set ComputerSet = Nothing

Set ServiceSet = GetObject("winmgmts:{impersonationLevel=impersonate}!//MY_PC").InstancesOf("Win32_ComputerSystemProduct")

For each Object in ServiceSet
        'Msgbox system.Caption
        'Msgbox system.Description
    '    msgbox system.IdentifyingNumber
        'msgbox "Product: " & Object.Name
        msgbox "Manufacturer: " & Object.Name
       
        'msgbox "Build: " & Object.BuildNumber
next

Set ServiceSet = Nothing

Please note that this is provided 'as is' with no warranties i.e. dont blame me if it all goes wrong!

Page 1 of 1

Thanks for your registration, follow us on our social networks to keep up-to-date