Solved

Find all machines which have static ip

Posted on 2007-03-21
8
278 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…

773 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