Solved

Find all machines which have static ip

Posted on 2007-03-21
8
296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
Suggested Courses

617 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