detect if computer is logged into network
detect if computer is logged into network
detect if computer is logged into network
detect if computer is logged into network
detect if computer is logged into network
detect if computer is logged into network detect if computer is logged into network detect if computer is logged into network detect if computer is logged into network detect if computer is logged into network detect if computer is logged into network detect if computer is logged into network detect if computer is logged into network
detect if computer is logged into network detect if computer is logged into network
detect if computer is logged into network
Go Back  Xtreme Visual Basic Talk > > > detect if computer is logged into network


Reply
 
Thread Tools Display Modes
  #1  
Old 05-27-2005, 07:23 AM
lernerda lernerda is offline
Freshman
 
Join Date: Mar 2005
Posts: 30
Default detect if computer is logged into network


Hi,

I am looking for the simplest method to detect if a computer is logged into the network.

Specifically, I am setting up a classroom intranet with 15 computers within our district internet, and will display which computers are actively logged on. (I will have a list of the 15 IP's to test).,but I am lost in how to write this paticular code.

I have found one bit of code, but it takes about two seconds to report the computer is not logged on. Is there a quicker way to test?

All help is appreciated

David
Reply With Quote
  #2  
Old 05-27-2005, 11:58 AM
George7a's Avatar
George7a George7a is offline
History: Jesus Is Risen
 
Join Date: Mar 2005
Location: Nazareth
Posts: 1,697
Default

Sorry, need to clear error for next computer...

Code:
'===========================================================
On Error Resume Next

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set logFile = objFSO.OpenTextFile("c:\computers.log",8)

strComputers = Array( <Computer Names...>)

For Each Computer in strComputers
   Set objWMIService = GetObject("winmgmts:" & "\\" & Computer & "\root\cimv2")
   If Err.Number <> 0 Then
        Set colSystemList = objWMIService.ExecQuery("Select * from Win32_ComputerSystem")
        For Each objSystem in colSystemList
            logFile.write("Computer: " & objSystem.Name & vbCRLF & _
                      "User: " & objSystem.UserName & vbCRLF & _
                      "Manufacturer: " & objSystem.Manufacturer & vbCRLF & _
                      "Model: " & objSystem.Model & vbCRLF & _
                      "Physical Memory: " & objSystem.TotalPhysicalMemory & _
                      vbCRLF & vbCRLF)
       Next
       Set colSystemList = nothing
   End If
   Err.Clear
   Set objWMIService = nothing
Next

Set FSO = nothing
Set logFile = nothing
'===========================================================
Good luck
__________________
Thabet.Net

Last edited by George7a; 05-27-2005 at 12:05 PM.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
detect if computer is logged into network
detect if computer is logged into network
detect if computer is logged into network detect if computer is logged into network
detect if computer is logged into network
detect if computer is logged into network
detect if computer is logged into network detect if computer is logged into network detect if computer is logged into network detect if computer is logged into network detect if computer is logged into network detect if computer is logged into network detect if computer is logged into network
detect if computer is logged into network
detect if computer is logged into network
 
detect if computer is logged into network
detect if computer is logged into network
 
-->