We have an estate of approximately 2000 laptops , these would sometimes go missing for whatever reason...
they could be under a developers desk , they may have been put in a cupboard and forgotten about or given to a user who took the machine home and "forgot" about it , i decided to create a simple batch file that would ping a list of computer names and when it received a reply send a mail to a user or a distribution list , here is the content of the batch file.
(obvously blat is required for this)
echo off
for /f "tokens=1" %%d in (computerlist.txt) Do Call :Pingthelost %%d
:pingthelost
set state=found
ping -n 1 %1
if errorlevel 1 set state=dead
echo %1 is %state%
If %state%==found call "c:\windows\system32\blat.exe" "c:\null.txt" -t Darragh.mcavinue@work.com -s "%1 is a missing computer which has appeared on the network"
simple !
UPDATE
we had what looked like a few false positives , the assets manager said that although he was beinga lerted that some computers were appearing on the network he was still unable to reach them.
I pinged one of the suspected false positives and got a reply from the router with a TTL expired , any computer that was on our remote access subnet that was being pinged was generating this error , this i suspect was the firewall policy for any of the machines on this subnet.
No comments:
Post a Comment