I need some help with WMI in dotnet

J

Jim Scheffler

Hello Group,

I've put together this code below which gets information from the local
computer and prints it in a text box. I would like to be able to do the same
to other computers on my network but I'm not sure how to point WMI to
another computer. Here is the code I have so far,

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim search As New ManagementObjectSearcher("SELECT * FROM Win32_BIOS")

Dim search2 As New ManagementObjectSearcher("SELECT * FROM
Win32_ComputerSystem")

Dim search3 As New ManagementObjectSearcher("SELECT * FROM Win32_Processor")

Dim info As ManagementObject

For Each info In search.Get()

TextBox1.Text = "Serial Number: " & info("serialnumber").ToString() & CRLF

TextBox1.Text += "Manufacturer: " & info("Manufacturer").ToString() & CRLF

Next

For Each info In search2.Get()

TextBox1.Text() += "Model: " & info("Model").ToString() & CRLF

TextBox1.Text() += "Computer Name: " & info("Name").ToString() & CRLF

TextBox1.Text() += "User Name Logged in: " & info("UserName").ToString() &
CRLF & CRLF

TextBox1.Text() += "Total Physical Memory: " &
info("TotalPhysicalMemory").ToString() & (" KB of Ram") & CRLF

Next

For Each info In search3.Get()

TextBox1.Text() += "CPU Clock Speed: " & info("Name").ToString() & CRLF

Next

End Sub

Thanks for any help or web links you can provide on this matter,

Jim Scheffler
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top