I need a way to identify current IP's for a specified Active Directory OU.

Posted on 2007-10-18
Last Modified: 2010-03-17
Does anyone know of a way, or perhaps have a script, that will associate current IP's to machine numbers by Active Directory OU?
Question by:Big-Brother
    LVL 30

    Expert Comment

    IP addresses of client computers are not stored in Active Directory in any way.

    Most times when this comes up, best option is to create a login script that captures the current IP and logs it to a centralized text file or (if you feel like doing some extra effort) a database.

    It's a difficult thing to maintain on an ongoing basis any way you slice it, since if you're using DHCP for client IP addresses, what happens when a workstation's IP address changes?
    LVL 10

    Expert Comment

    One of the clever scripty people here might be able to produce a script that exports the machine names from an OU to a text file, then pings the machine names in the file and saves the results (which would be in the form of IP addresses) to an output file.

    Author Comment

    I don't need something that would have to be maintained.  It just needs to be able to take a snapshot of the current IP assignments of a specified OU so I can perform vulnerability and penetration tests on the machines within the OU.  When I need to do another test I would execute the script again so any IP address changes would be reflected.

    I thought, perhaps, someone had already done this.  I have had script people tell me this shouldn't be very hard but no one has time to work on it.  
    LVL 48

    Accepted Solution

    i cant script so here is a link to a script that will ping all the machines in a list

    use dsquery to ouput the names of all machines to a text file based on the OU and then run the script - two part process but it will work
    dsquery user ou=OUName,DC=Domain,DC=com > c:\Filename.txt
    LVL 1

    Expert Comment

    Forced accept.

    Community Support Moderator

    Featured Post

    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.

    Join & Write a Comment

    There are two modes of restricted groups GPOs. Replacing mode:   Additive mode:   How do they work? Replacing mode: Everything (users, groups, computers) that is member of the local administrators group will be cleared out. After th…
    This is my first article in EE and english is not my mother tongue so any comments you have or any corrections you would like to make, please feel free to speak up :) For those of you working with AD, you already are very familiar with the classi…
    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 to another domain controller. Log onto the new domain controller with a user account t…
    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 …

    729 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

    24 Experts available now in Live!

    Get 1:1 Help Now