WMI question

J

Jm

Hi all

I found this code which was designed for VBscript and uses wmi. Im sure
there is a way to convert it for use into VB.NET but im unsure of what to
do. I know under vb you would a refernce to wmi but i cant find how to do
this is .NET

Thanks
 
J

Jm

This is the code in question

ComputerName = InputBox("Machine Name To Query")

Logon = "winmgmts:{impersonationLevel=impersonate}!//"& ComputerName &""
Set Users = GetObject( Logon ).InstancesOf ("Win32_ComputerSystem")

For each User in Users
MsgBox "Current Logged on user : " & User.UserName
Next
 
H

Herfried K. Wagner [MVP]

Jm said:
I found this code which was designed for VBscript and uses wmi. Im sure
there is a way to convert it for use into VB.NET but im unsure of what to
do. I know under vb you would a refernce to wmi but i cant find how to do
this is .NET

Notice that there is a separate group for .NET+WMI available:

<URL:http://groups.google.de/groups?hl=en&group=microsoft.public.dotnet.framework.wmi>

Article:

Exploring WMI: Integrate WMI into the .NET Framework
<URL:http://www.devx.com/dotnet/Article/20162/>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top