Solved

Find all machines which have static ip

Posted on 2007-03-21
8
256 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
 
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

Join & Write a Comment

Remote Apps is a feature in server 2008 which allows users to run applications off Remote Desktop Servers without having to log into them to run the applications.  The user can either have a desktop shortcut installed or go through the web portal to…
Synchronize a new Active Directory domain with an existing Office 365 tenant
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now