locked
How to get System Information on Windows2000 without WMIC RRS feed

  • Question

  •  It is quite easy to get information like baseboard manufacturer, os version, memorychip model through WMIC. However, this instrument is not accessible on Wincows 2000. Can anyone give me suggestion on how to get these Information?

    I am using Java. Should I try JNI? If so, can any one gives me some examples or resourses? Thank you.

     
    • Changed type Richard MuellerMVP Monday, October 27, 2014 12:29 PM op is asking a question
    Friday, October 24, 2014 7:24 AM

Answers

  • wmic uses wmi, wmi does exist on windows 2000..

    wmi can also be queried using vbscript (or java or any other program for that matter) http://msdn.microsoft.com/en-us/library/aa394582(v=vs.85).aspx

    I would recommend to use scriptomatic to easily find out available classes and generate sample script(s). WMI Code Creator is a valid alternative if you need more functionality or want to generate c# code.

    if you need a quick commandline solution, you could check if 'systeminfo' command provides the info you need.

    Note that Windows 2000 will not contain all tools and wmi classes that are documented for more recent OS'es and you will have a hard time finding good documentation as it is out of support for a long time already.



    MCP/MCSA/MCTS/MCITP

    Friday, October 24, 2014 9:20 AM

All replies

  • wmic uses wmi, wmi does exist on windows 2000..

    wmi can also be queried using vbscript (or java or any other program for that matter) http://msdn.microsoft.com/en-us/library/aa394582(v=vs.85).aspx

    I would recommend to use scriptomatic to easily find out available classes and generate sample script(s). WMI Code Creator is a valid alternative if you need more functionality or want to generate c# code.

    if you need a quick commandline solution, you could check if 'systeminfo' command provides the info you need.

    Note that Windows 2000 will not contain all tools and wmi classes that are documented for more recent OS'es and you will have a hard time finding good documentation as it is out of support for a long time already.



    MCP/MCSA/MCTS/MCITP

    Friday, October 24, 2014 9:20 AM
  • Thank you for your advises.

    But when I refer to WMI .NET(http://msdn.microsoft.com/en-us/library/bb404655.aspx), I find the notion for .NET framwork 3.5(under overview). As far as I know, this version do not exist on windows 2000. 

    Should I still choose C# as my program language? (I am a novice, so apologize for stupid questions)

    Monday, October 27, 2014 9:15 AM
  • Hi,

    I would recommend writing a simple vbscript.

    both tools i linked to can do the basics for you.


    MCP/MCSA/MCTS/MCITP

    Monday, October 27, 2014 11:21 AM
  • Thank you for your advises.

    But when I refer to WMI .NET(http://msdn.microsoft.com/en-us/library/bb404655.aspx), I find the notion for .NET framwork 3.5(under overview). As far as I know, this version do not exist on windows 2000. 

    Should I still choose C# as my program language? (I am a novice, so apologize for stupid questions)

    C# does not exist for Windows 2000 unless you have an old copy of the MSDN library.  None of it including Windows 2000 are supported. Windows 2000 has been obsolete and unsupported for years.

    Use the links from Richard Mueller above.  THat is you only choice but do not expect any amount of support in your endeavor.


    ¯\_(ツ)_/¯

    Monday, October 27, 2014 2:31 PM
  • WMI and VBScript (or even PowerShell) can be used for your needs. You just need to find the WMI classes you need, and the properties exposed by those classes. Here is an example using the Win32_ComputerSystem class, to retrieve information from the current local computer. You could substitute the NetBIOS name of a remote computer, if you have permissions to query remotely:

    Option Explicit
    
    Dim strComputer, objWMIService, colItems, objItem
    
    Const wbemFlagReturnImmediately = &h10
    Const wbemFlagForwardOnly = &h20
    
    strComputer = "."
    
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
    Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_ComputerSystem", "WQL", _
        wbemFlagReturnImmediately + wbemFlagForwardOnly)
    
    For Each objItem In colItems
        Wscript.Echo "Server Name: " & objItem.Name
        Wscript.Echo "BootupState: " & objItem.BootupState
        Wscript.Echo "CurrentTimeZone (Offset from GMT in Minutes): " & objItem.CurrentTimeZone
        Wscript.Echo "Description: " & objItem.Description
        Wscript.Echo "Domain: " & objItem.Domain
        Wscript.Echo "Manufacturer: " & objItem.Manufacturer
        Wscript.Echo "Model: " & objItem.Model
        Wscript.Echo "NumberOfProcessors: " & objItem.NumberOfProcessors
        Wscript.Echo "TotalPhysicalMemory: " & Round(objItem.TotalPhysicalMemory/(1024*1024)) & "MB (Approx.)"
        Wscript.Echo "Console Logged-on UserName (if any): " & objItem.UserName
    Next

    I have a more elaborate script to inventory all computers in a domain linked below. In particular, this example uses the Win32_OperatingSystem class to retrieve the Caption, Version, ServicePackMajorVersion, and ServicePackMinorVersion properties for each computer and document in an Excel spreadsheet:

    http://www.rlmueller.net/Inventory.htm

    I'm sure there are more examples in the script gallery. You can start here:

    https://gallery.technet.microsoft.com/site/search?f%5B0%5D.Type=RootCategory&f%5B0%5D.Value=activedirectory&f%5B0%5D.Text=Active%20Directory


    Richard Mueller - MVP Directory Services

    Monday, October 27, 2014 3:05 PM
  • Thank you all for valuable advices!
    Friday, October 31, 2014 8:28 AM