Solved

VB Script to verify computer is on-line

Posted on 2009-07-14
6
407 Views
Last Modified: 2012-05-07
I need a VB Script to verify a group of computers in active directory are on-line each night.  When they are off-line 3 consecutive nights, then I need to be either given a report or notified.  The script could even save the report to a server share if need be.  The script does not have to query active directory.  If I need to, then I could supply a text file with all of the computer names.
0
Comment
Question by:bbanis2k
  • 4
  • 2
6 Comments
 
LVL 25

Expert Comment

by:SStory
ID: 24850261
You could PING the machine:

if Ping(strHost) = True then
    'responded
    'in here you could log it somehow
else
    'in here you could log it somehow
end if

However, firewalls and hibernation/, etc could cause problems with this.


0
 

Author Comment

by:bbanis2k
ID: 24850504
Does not seem like a good option.
0
 
LVL 25

Expert Comment

by:SStory
ID: 24858669
OK. What do you mean by online or offline? Reachable by the network?  If so pinging is a good test.
If you want to step up to VB.NET, you could do something similar to ping, or you could connect to a share via UNC paths and if you cannot consider the machine offline.  Firewalls and hibernation could still cause it to fail.  If it is a machine that should always be on, then hibernation and "sleeping" should be turned off and the firewalls adjusted to allow you to do whatever check you need to.

Are these machines in house and on the same network?

There is another more technical way of doing it. you could have a vb.net client program run on each of the machines that you want to watch and a special version running on the monitor.  Have the controller broadcast a message over the subnet broadcast (UDP), saying "Who's out there" and see who responds and keep a log. This would require a lot more code. There are examples on the internet.
Of course Windows does that all of the time to see who is out there.

As for an AD way to do it, I don't know how, but someone else may.
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

Author Comment

by:bbanis2k
ID: 24860085
Same network...I just want to avoid ICMP traffic, due to firewall rules in Windows.

0
 
LVL 25

Accepted Solution

by:
SStory earned 500 total points
ID: 24861196
yes, I understand

OK. you could try to do something with WMI:

Here is a link to someone doing it remotely.
http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_23213918.html

0
 
LVL 25

Expert Comment

by:SStory
ID: 24861208
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now