Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


WMI Cimv2 Classes and their Values - HTA Browser

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,42880
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> WMI Cimv2 Classes and their Values - HTA Browser
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 WMI Cimv2 Classes and their Values - HTA Browser - 2/5/2007 11:25:58 AM   
  dm_4ever


Posts: 2359
Score: 36
Joined: 6/29/2006
From: Orange County, California
Status: offline
The following code is for an HTA that will dynamically list all the available classes under the cimv2 namespace.  It will query the local machine initially, but you can specify a remote machine and alternate credentials should you require it. You will notice a lot of the same functions/subs as my "scripts currently running" (http://www.visualbasicscript.com/m_41962/tm.htm) or Win32_Ping (http://www.visualbasicscript.com/m_42535/tm.htm) posts. 

Though you can retrieve a lot of this information using wbemtest or ms' WMI object browser or generate WMI queries using WMI Code creator or Scriptomatic, this HTA is intended to quickly and easily let you select a class name (without having to look it up) and see only those properties that contain data immediately.  The filter text field lets you filter down your results.  Simply put in what you would normally specify in a "where" clause. For example, if looking at the Win32_NetworkAdapterConfiguration, a valid filter would be: ipenabled=true .  For the Win32_PingStatus, a valid filter would be ipaddress='www.yahoo.com' or ipaddress='www.yahoo.com' and timeout=2000 .

Rather than display the methods for each class, I decided to turn the class name displayed into a link to Microsoft MSDN so that you can look up the documentation for yourself and see what methods are available and how to use them.

This version was tested on a WinXP/2k3 box.  There is a function to convert UTC time to regular time so all date/times will appear in their standard form; just so you're not surprised why it looks that way with this HTA and different when you create your own query.  A .NET array is used to sort the available classes in alphabetical order and IE object is created for a progress type window.

Becareful when selecting classes that contain a large amount of data. CIM_Datafile, Win32_NTEventLog, etc. without using some filtering.

Well enough with that, here's the code.
If anything, this can serve as an example to the functions used to create this.


      

Version 2 (allows for more specific queries)

      

< Message edited by dm_4ever -- 3/3/2007 2:48:53 AM >


_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm
 
 
Revisions: 6 | Post #: 1
 
 RE: WMI Cimv2 Classes and their Values - HTA Browser - 2/6/2007 5:59:07 AM   
  Parabellum


Posts: 222
Score: 0
Joined: 11/12/2006
From: UK
Status: offline
nice... very useful for me too seeing as i have another problem

does anyone know why this runs fine... yet i can't run the microsoft scriptomaticv2 under Vista with IE7??

(in reply to dm_4ever)
 
 
Post #: 2
 
 RE: WMI Cimv2 Classes and their Values - HTA Browser - 2/7/2007 10:09:39 AM   
  Parabellum


Posts: 222
Score: 0
Joined: 11/12/2006
From: UK
Status: offline
just an idea for the next version.... how about a filter for the information it selects from the class
eg..

wmiQuery  = "Select " & strMyFilter & " From "  & strClass & " Where " & strWQL

could be usful for seaching for name or caption info

(in reply to Parabellum)
 
 
Post #: 3
 
 RE: WMI Cimv2 Classes and their Values - HTA Browser - 2/7/2007 10:37:51 AM   
  dm_4ever


Posts: 2359
Score: 36
Joined: 6/29/2006
From: Orange County, California
Status: offline
, sounds like a good idea. I'll update the original post when those and any other changes are made.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Parabellum)
 
 
Post #: 4
 
 RE: WMI Cimv2 Classes and their Values - HTA Browser - 2/25/2007 5:20:33 PM   
  dm_4ever


Posts: 2359
Score: 36
Joined: 6/29/2006
From: Orange County, California
Status: offline
Updated the original post with a second version of this HTA to allow you to choose what properties to display.

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to dm_4ever)
 
 
Post #: 5
 
 RE: WMI Cimv2 Classes and their Values - HTA Browser - 3/29/2007 1:08:25 AM   
  mcds99


Posts: 421
Score: 4
Joined: 2/28/2006
Status: offline
Another great script from dm_4ever.

You've taken Cool to another level!

_____________________________

Sam

Keep it Simple Make it Fun KiSMiF

(in reply to dm_4ever)
 
 
Post #: 6
 
 RE: WMI Cimv2 Classes and their Values - HTA Browser - 3/30/2007 12:30:46 PM   
  dm_4ever


Posts: 2359
Score: 36
Joined: 6/29/2006
From: Orange County, California
Status: offline
Thank you!

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to mcds99)
 
 
Post #: 7
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> WMI Cimv2 Classes and their Values - HTA Browser Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts