Getting information about methods and properties

Maybe I'm being thick but I find it very difficult to identify resources that list methods and properties for objedcts created in scripting.

For example in the code:-

Set objWMI = GetObject("winmgmts:" _
              & "{impersonationLevel=impersonate}!\\" _
              & strComputer & "\root\cimv2")

Set colSessions = objWMI.ExecQuery _
      ("Select * from Win32_LogonSession Where LogonType = 10")

If colSessions.Count = 0 Then
   Wscript.Echo "No interactive user found"
Else
   For Each objSession in colSessions

     Set colList = objWMI.ExecQuery("Associators of " _
         & "{Win32_LogonSession.LogonId=" & objSession.LogonId & "} " _
         & "Where AssocClass=Win32_LoggedOnUser Role=Dependent" )

     For Each objItem in colList
       WScript.Echo "User: " & objItem.Name
       WScript.Echo "FullName: " & objItem.FullName
       WScript.Echo "Domain: " & objItem.Domain
     Next
     Wscript.Echo "Start Time: " & objSession.StartTime
   Next
End If

Where can I find a defintive list for the objects "objItem"  and "objSession"?
LVL 1
cescentmanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

TheCleanerCommented:
Well, you could use a scripting tool like PrimalScript that auto-fills.

But you can get a list of all the WMI objects and methods by opening this program:

In here:  C:\windows\system32\wbem

run wbemtest.exe

Then click Connect.

Change the namespace to root\CIMv2

Then the buttons will appear.

Click enum classes, choose recursive and hit OK.  This will list all the classes.

Find the class you are talking about...for instance Win32_LogonSession and click OK.

It will then list the class and the associated properties and/or methods.  (for LogonSession there are just properties)

You can even choose a property or method and get a list of all the existing instances right there by click "Instances".

Hope that helps.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TheCleanerCommented:
Thanks for the points!
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

cescentmanAuthor Commented:
Good tip it was I never cease to be amazed by the way I am constantly discovering features that live as default on my PCs and servers. Only yesterday I came accross references to qwinsta.exe on TS boxes what a boon I've used it twice today.
0
TheCleanerCommented:
:) plenty of hidden goodness.
0
Giuseppe "Pino" De FrancescoSenior Solution ArchitectCommented:
About scripting... if you want to be surprised about how many things you can do and how simply, have a look to http://kixtart.org/

Cheers
Pino
0
cescentmanAuthor Commented:
I've often toyed with KIX I like it a lot and I agree that in many ways it is more accesible but I am trying to concentrate on not using anything other than native MS features as it is easier to quickly port script.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Server 2003

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.