Link to home
Start Free TrialLog in
Avatar of ljasperson
ljasperson

asked on

Batch File - PING list of computers (list is a dynamic changing file)

I want to create a DOS Batch File that will automate a PING process for workstations listed in the Computers OU of Active Directory.  There are around 4000 computer listings in this OU and I would like a script to PING all of these computer names and output the results to a file so it can be sorted through to determine which systems are from what subnets (and offices).

You can easily export the list of the Computers OU from Active Directory to a CSV file and resave
this into a text format.  But, how to get this process to work properly?

FOR %%i IN (A1 A2 A3 A4 ...) DO PING %%i >> RESULTS.TXT

But, I don't want to list 4000 individual workstations for parameters and I would like the variable
parameter to be dynamic and point to a source file (computers.txt) for the computer listing - which can be changed and updated, so this batch file can be run again at a later time for new results.

Any ideas how to make this work?  Is there a different command that should be used?

Bonus Question: A way to parse the results into organized subnet listings, so not to have to do
any "manual sifting" through the results file

Thanks.
Avatar of testn
testn

There is a tool called scanline from foundstone. It is very easy to use. You'd better try it. Much better than Ping. You can scan subnet, too
ASKER CERTIFIED SOLUTION
Avatar of YarnoSG
YarnoSG
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
FYI:  you do not need to convert the CSV to a text format;  it already is;  just include the comma in your delims= statement.