Solved

Count Computers on Network?

Posted on 2012-03-28
4
345 Views
Last Modified: 2012-04-12
I have to get a count of how many computers are at our facility. I'm hoping for a easier way other than physically walking and counting each one here.

Q1:Is there a way to count how many computers is on the network?

If possible

Q1 Part 2: Is there a way to count also the computers not on the network along with it? (meaning counting workgroups)
If not just having the ones on the network will cut a lot of time down in counting them all.

If it helps any we have SBS 2011, and a Cisco ASA 5510.
0
Comment
Question by:Pancake_Effect
4 Comments
 
LVL 10

Assisted Solution

by:pclinuxguru
pclinuxguru earned 125 total points
ID: 37778013
Fast and furious way is to count your DHCP leases. Subtract the ones you know aren't machines.

If you not in a hurry you could setup a spiceworks (www.spiceworks.com) server and let it run for a week or so and it should give you an accurate count. I say let it run for a week or so for the machines that are turned off or laptops.
0
 

Assisted Solution

by:aitg
aitg earned 125 total points
ID: 37778225
You can use the arp -a command to report all devices in the arp table, but that would not distinguish computers from other networked devices. If you want a definitive list of networked devices, with graphical output, you can download jNetMap.
0
 
LVL 3

Assisted Solution

by:john M
john M earned 125 total points
ID: 37778461
here is now to do it in .net
i use this to read all the event logs on our network

Imports System.Data
Imports System.Net.NetworkInformation
Imports System.Runtime.InteropServices
Imports System.IO.File
Imports System.Configuration
Imports Registration.Exams
Imports System.Data.SqlClient
Imports System
Imports System.IO
Imports System.Xml
Imports Microsoft.VisualBasic
Imports System.Net
Imports System.Web

Imports System.Net.Sockets
Imports System.Text.RegularExpressions
#Region "Get network computers"
    Public Function GetNetworkComputers() As ArrayList
        Dim networkComputers As New ArrayList()
        Const MAX_PREFERRED_LENGTH As Integer = -1
        Dim SV_TYPE_WORKSTATION As Integer = 1
        Dim SV_TYPE_SERVER As Integer = 2
        Dim buffer As IntPtr = IntPtr.Zero
        Dim tmpBuffer As IntPtr = IntPtr.Zero

        Dim entriesRead As Integer = 0
        Dim totalEntries As Integer = 0
        Dim resHandle As Integer = 0
        Dim sizeofINFO As Integer = Marshal.SizeOf(GetType(_SERVER_INFO_100))

        Try
            Dim ret As Integer = NetServerEnum(Nothing, 100, buffer, MAX_PREFERRED_LENGTH, entriesRead, totalEntries, _
                                               SV_TYPE_WORKSTATION Or SV_TYPE_SERVER, Nothing, resHandle)

            If ret = 0 Then
                For i As Integer = 0 To totalEntries
                    tmpBuffer = New IntPtr(CType(buffer, Integer) + (i * sizeofINFO))
                    Dim svrInfo As _SERVER_INFO_100 = CType(Marshal.PtrToStructure(tmpBuffer, _
                                                            GetType(_SERVER_INFO_100)), _SERVER_INFO_100)
                    ' If svrInfo.sv100_name.Substring(0, 1) <> "A THRU Z" Then
                    'If (svrInfo.sv100_name.Substring(0, 10)) = "DANB-HOMER" Then
                    '    networkComputers.Add(svrInfo.sv100_name)
                    'Else


                    If svrInfo.sv100_name.Length < 4 And svrInfo.sv100_platform_id = "400" Then
                        networkComputers.Add(svrInfo.sv100_name)
                    Else
                        If (svrInfo.sv100_platform_id = "400") Then
                            networkComputers.Add(svrInfo.sv100_name)
                            'End If

                        End If
                    End If
                    ' If (svrInfo.sv100_name.Substring(0, 10)) = "DANB-HOMER" Then
                    'networkComputers.Add(svrInfo.sv100_name)
                    'End If
                Next
            End If
        Catch ex As Exception
            Console.WriteLine("Error getting network computers.")
        Finally
            NetApiBufferFree(buffer)
        End Try

        Return networkComputers
    End Function
#End Region

    ' Example Usage
    Public Sub getall()
        Dim networkComps As ArrayList = GetNetworkComputers()
        For Each Str As String In networkComps
            MsgBox(Str)
        Next

        'Next
    End Sub
0
 
LVL 11

Accepted Solution

by:
Khandakar Ashfaqur Rahman earned 125 total points
ID: 37781357
arp -a command will only show those physical addresses which are already resolved.If any host has ICMP reply disabled by firewall can't be shown into ARP cache.

Most of the tools are ICMP based.If you ICMP scan into your network it might not be correct because some machines won't reply if ICMP is blocked by firewall.

However, I'd request you to use NMAP:
http://nmap.org/dist/nmap-5.51-setup.exe

If your network is 192.168.0.0/24 then:

Target: 192.168.0.0/24
Profile: Intense Scan No ping

You also can choose Intense Scan to determine about OS and device type and open ports.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Monitoring Exchange 2013 8 122
Nexus 5K switch Managment 2 72
Configure HP 5500 Switch with Comware 15 166
asset management of client side devices laptops/computers 1 55
As companies replace their old PBX phone systems with Unified IP Communications, many are finding out that legacy applications such as fax do not work well with VoIP. Fortunately, Cloud Faxing provides a cost-effective alternative that works over an…
Use of TCL script on Cisco devices:  - create file and merge it with running configuration to apply configuration changes
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question