General discussion
April 28, 2003 at 04:29 AM
laj

Batch – PING list of computers (dynamic)

by laj . Updated 23 years, 5 months ago

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.

This discussion is locked

All Comments