Pinging computers in Active Directory

Associate
Joined
3 Jan 2009
Posts
2,056
Location
London
Hi all, I'm very much hoping one of you can help me with this :)

Its as title says, I have these laptops in Active directory which I want to ping, now what I wanted to do is export them into txt format and make some sort of batch file to ping them.

I have no idea how to do this, can somebody point me in the right direction pleasee :D

I have attached a screenshot so you guys can see the computers I'm trying to ping.

85793767.jpg
 

Saw this, not quite what I wanted ;)

I managed to do it in the end by writing all names up in excel, then writing the code and then copying that into a text document.

What are you trying to achieve? Based on your simple requirements something like:

Aim was to figure out which computers were in cupboard or bin. If they haven't been turned on in a week they lose their IP address and say its not a recognised IP address whereas if a PC is just off and has been turned on in the last week it says something else.

Because all PCs here are likely to have been turned on in the last week its easy to know which are still active and which are dead ;)

If that makes any sense at all?
 
Nope.

If you want to find out which are dead, then perhaps ping them each week and determine which have been off for x weeks, then remove them from AD. My script above could easily be amended to do that.

Your script looks way beyond me :p

I managed to do what I was trying to do though so dw :)
 
Sorry guys I forgot to check back to answer all your questions, I rarely venture into this part of the forum :p

The only reason I would see doing the script would be to see which computers are left on at night as judging by your AD name it looks like a school :D.

We have a script to turn off all computers so there is never a need to do this anyway. ;)

Still not making much sense why you want to do this.

If a computer is in a bin! You should know about it, hopefully users aren't just binning laptops!

If a user is off on 2+ weeks holiday your task will assume they are dead!

If its to do with DHCP addresses, just set a shorter lease.

In our cupboard there are 3 broken dell laptops which I immediately replaced with any old computer to ensure that the teachers could still have a computer on their desk; unfortunately I forgot to remove these computers from AD until now.

Ok, because I work in a school and all these laptops are required for the teacher to teach a lesson each and every laptop will have been turned on in the last 7days.

If a computer has not been turned on in 1 week it loses an IP address (these computers will be the ones in the cupboard) if a computer is off, it will still have an IP address but not reply when it is pinged giving a different message, and computers that are on will obviously reply when pinged.

So there are 3 different replies a PC can give:

- Computer replys and is therefore turned on
- Computer doesn't reply but still has IP address
- Computer doesn't reply and has no IP address (these are computers that are broken)

This means I can identify the names of the computers in the cupboard (The ones that don't reply and don't have an IP address) and delete them from AD.

I managed to do exactly what I wanted to do perfectly. :)

Edit: I know it works because I know how many dell laptops we have and how many in the cupboard are broken so if something was wrong I could obviously tell.

Does that now make sense?

Oh and one of you is a husband to a teacher here? She said something about this thread so hello to you :p
 
Back
Top Bottom