Jump to content

Ping all PCs in domain


Recommended Posts

I copied ping.exe to a root drive on a domain controller. Along with this i created a text file called PC.txt (which lists all the PCs in our domain) and a batch file with the command

ping.exe pc.txt >> answer.txt

When i run this batch it doesnt return any ping results in answer.txt- how can i ping all pcs in a domain?

thx

Link to comment
Share on other sites


You can't do that with DOS, you'll need to rewrite it into vb script:

for ($i = 1; $i -le 256; $i++) { $cmd = "ping 192.168.96." + $i; invoke-expression $cmd }

If you haven't heard of it, Powershell is MS's equivalent to a Unix shell

http://www.microsoft.com/windowsserver2003...ll/default.mspx

It requires XP/2003/Vista and .Net 2.0 installed.

Edited by travisowens
Link to comment
Share on other sites

You can't do that with DOS, you'll need to rewrite it into vb script:

Really? :w00t:

I would have thought that something like:

For /F "tokens=* delims=" %%A in (pc.txt) DO Ping %%A >> answer.txt

would work.... :whistle:

@Bad boy Warrior

Please read here a good tutorial about using the above command:

http://www.robvanderwoude.com/ntfortokens.html

and extracting needed data...

jaclaz

Edited by jaclaz
Link to comment
Share on other sites

@travisowens - your solution will not ping every machine in a domain. only in a subnet.

jaclaz's solution will at least ping every machine in the text file. Which if the query to create it was done correctly can have every machine in the domain listed in it.

If you want to eliminate the text file you could use VBS to query the domain for machines and then ping them.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...