WMI question

  • Thread starter Thread starter Jm
  • Start date Start date
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
 
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
 
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/>
 
Back
Top