Solved

Find all machines which have static ip

Posted on 2007-03-21
8
285 Views
Last Modified: 2010-03-05
Hi,

Can we find all machine on the network which have static ip's.

For some reason we have given static ip addresses for some servers long ago as of now we dont know the machine name.Is it possible to find which all machines in the domain (Network) we have given ststic ip address.

Regards
Sharath
0
Comment
Question by:bsharath
8 Comments
 
LVL 30

Expert Comment

by:LauraEHunterMVP
ID: 18764675
Unfortunately, IP address information is not recorded by Active Directory. To get this information you'll need to use a login script or some other type of management tool against every machine on your network.

The following Visual Basic script, for example, will run against the local computer and indicate whether DHCP is enabled on all of the installed NICs on the system. You could include something like this in a login script or use a tool like PSExec to run it against every machine in your domain/forest at once:

On Error Resume Next
 
strComputer = "."
 
Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colNicConfigs = objWMIService.ExecQuery _
 ("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True")
 
For Each objNicConfig In colNicConfigs
  strDNSHostName = objNicConfig.DNSHostName
  strIndex = objNicConfig.Index
  strDescription = objNicConfig.Description
  blnDHCPEnabled = objNicConfig.DHCPEnabled
  strDHCPSettings = strDHCPSettings & VbCrLf & VbCrLf & _
   "  Network Adapter " & strIndex & VbCrLf & _
   "    " & strDescription & VbCrLf & VbCrLf & _
   "    DHCP Enabled:        " & blnDHCPEnabled
Next
 
WScript.Echo VbCrLf & "DHCP Settings" & VbCrLf & VbCrLf & _
 "Host Name: " & strDNSHostName & strDHCPSettings

Hope this helps.

Laura E. Hunter - Microsoft MVP: Windows Server - Networking
0
 
LVL 16

Expert Comment

by:poweruser32
ID: 18765875
one way but it depends on how big a network you are talking about would be  looking at the dhcp scope in AD and you will find out the exclusion address list for static ips
than you will be able to get static names using the dns commands
0
 
LVL 6

Expert Comment

by:shayneg
ID: 18766819
Check your DHCP scope to see what pool of addresses your giving out then download nad run the following tool:   http://www.softperfect.com/download/netscan.exe.

Scan your network and see what i.p addresses don't appear in your DHCP scope. These addresses will be the static ones :0)
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 11

Author Comment

by:bsharath
ID: 18769126
Hi, LauraEHunterMVP

I get this error.
C:\>cscript b.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

C:\b.vbs(24, 11) Microsoft VBScript compilation error: Expected end of statement

Regards
Sharath
0
 
LVL 11

Author Comment

by:bsharath
ID: 18769128
poweruser32:

My company has 2500 systems can you please explain.
0
 
LVL 30

Expert Comment

by:LauraEHunterMVP
ID: 18770495
This script runs fine against my local workstation.  Be sure that you are not encountering any line-wrapping or End-Of-Line issues when copying and pasting. Paste the code into Notepad to remove any extraneous HTML formatting (not Wordpad or Word), and be sure that no text lines are wrapping incorrectly: the code should appear in Notepad exactly as it shows up in the original message.
0
 
LVL 11

Author Comment

by:bsharath
ID: 18770545
Thanks it works for me on my local machine but how do i find for all machines on the network.?
0
 
LVL 30

Accepted Solution

by:
LauraEHunterMVP earned 500 total points
ID: 18770596
You would need to include this in a login script or run it manually using a tool like PSExec, which allows you to run commands against remote computers.  You'll also want to replace the WScript.Echo command with something that will write the results to a text file, see the following for a tutorial on using VBScript to write to a text file: http://www.computerperformance.co.uk/vbscript/vbscript_file_opentextfile.htm.
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

820 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