?
Solved

VB Script to verify computer is on-line

Posted on 2009-07-14
6
Medium Priority
?
412 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Get MySQL database support online, now!

At Percona’s web store you can order your MySQL database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card.

 

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 2000 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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Suggested Courses

764 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