I need help with a VBscript to query WMI and resturn system stats for multiple Windows OS

Posted on 2011-10-25
Last Modified: 2012-05-12
I have very little experience with WMI, but know that it is very powerful and can be used to return lots of information about a running system.  I would like to create a VBscript that I can schedule to run which will write out system stats at run time about the system.  The script needs to work on any windows version that supports WMI.  The metrics I care about are as follows:

- Show OS Name and Version
- Show service pack level
- List CPU
  - List CPU utilization

- Enumerate Network connections
  - List IP Address
  - List Subnet
  - List Gateway
  - List DNS
  - DHCP/Static?
  - List KB/in
  - List KB/out

  - Enumerate all volumes
  - List drive letter and/or volume name
  - List size
  - List freespace
- Enumerate all mapped drives
  - List drive letter

- List Total MEM size in MB
- List Available Mem in MB

- List running services

Has anyone written something like this that they can get me started on?  I have one, but it doesn't work like it should and I am looking for help.  Thanks in advance!
Question by:electricd7
    LVL 76

    Accepted Solution

    There are TONS of examples out there on many of these.  This is also quite an extensive list.

    Is there one more important you would like help with?  I cannot see any Expert writing the entire project for you but I could be wrong.


    >>The script needs to work on any windows version that supports WMI

    I'm far from a WMI Expert but I can guess what works today can change tomorrow.  not sure if three is a 100% backwords/forwards compatibility.

    Author Comment

    I need the most help with processor utilization and network utilization.  The others are pretty easily defined.
    LVL 76

    Assisted Solution

    by:slightwv (䄆 Netminder)
    I've done very little with WMI and CPU/Network isn't one of the things I've done.

    See if this has the info you need for CPU:

    Author Comment

    OK I got CPU now.  Basically all I am missing is the ability to list all network adapters and their associated info.
    LVL 76

    Assisted Solution

    by:slightwv (䄆 Netminder)
    Sorry.  I've been looking for overall network utilization.

    NIC info is: Win32_NetworkAdapter

    The list is here:

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Microsoft Windows Server Update Service (WSUS) is free for everyone, but it lacks of some desirable features like send an e-mail to the administrator with the status of all computers on the WSUS server. This article is based on my PowerShell script …
    Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
    Need more eyes on your posted question? Go ahead and follow the quick steps in this video to learn how to Request Attention to your question. *Log into your Experts Exchange account *Find the question you want to Request Attention for *Go to the e…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now