Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Find all machines which have static ip

Posted on 2007-03-21
8
Medium Priority
?
303 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
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.

 
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 2000 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Let's recap what we learned from yesterday's Skyport Systems webinar.
In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
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…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

705 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